How Do I aggregate Data By Day and Still Respect Timezone?

后端 未结 3 2012
逝去的感伤
逝去的感伤 2021-02-14 06:27

We are currently using a summary table that aggregates information for our users on an hourly basis in UTC time. The problem we are having is that this table is becoming too la

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 07:33

    Summarise the data in tables with a timeoffset column, and a "day" field (a date) that is the day for that particular summary line. Index on (timeoffset, day, other relevant fields), clustered if possible (presumably PostgresSQL has clustered indexes?) and all should be well.

提交回复
热议问题