4 ms·
I think what's meant here is windowing (partitioning the query) not partitioning the table per se. Though even with this strategy, you must manually create new
by kbolino 2y ago
I think what's meant here is windowing (partitioning the query) not partitioning the table per se. Though even with this strategy, you must manually create new partitions all the time.
This also isn't typical time-series data, which generally stores numbers. Supposing you had a column "value INTEGER" as well, how do you do something like the following (pseudo-SQL)?
SELECT AVG(value) AS avg_value FROM logs GROUP BY INTERVAL '5m'
Which should output rows like the following, even if the data were reported much more frequently than every 5 minutes:
log_time | avg_value
2024-05-20T00:00:00Z | 10.3
2024-05-20T00:05:00Z | 7.8
2024-05-20T00:10:00Z | 16.1
- ants_a 2y agoSELECT date_bin('5 minutes', log_time, '2000-01-01') log_time, AVG(value) avg_value FROM logs GROUP BY 1