TimescaleDB 00:00:01 Where does yesterday's reading go? An offline thermostat reconnects carrying readings from two weeks ago. A TimescaleDB hypertable looks like one SQL table, but time determines which underlying chunk receives each reading. The example uses four time chunks with seven days in each. A current reading falls in the interval for week four. The delayed reading belongs to week two, so the engine routes it to the older chunk. The first reading of week 5 creates a chunk. The routing key here is the event timestamp. Arrival order can change which chunks are touched today, even when all inserts arrive through the same table name. 00:00:40 Find device forty-two in week three A technician wants week three's temperatures for one device. That question naturally has two filters. The database can use the time interval before it looks inside individual chunks. Device 42, from the start to the end of week 3. Weeks 1, 2 and 4 cannot contain the range. Inside week 3 the index on device and time finds the rows. Without a restrictive time predicate, the lookup may need to examine all the relevant time chunks. Removing the time predicate changes the amount of historical data that the planner needs to consider. A precise customer question is often the least expensive optimization. 00:01:22 Store older readings by device and time Recent writes and historical scans have different access patterns. In the column-oriented example, group older readings by their device and order the readings within each group by time. Six readings as they arrived. The numbers under time are minutes. Equal segment values come together. Newest first inside each segment. Recorded time bounds allow the reader to skip a batch whose entire interval lies outside the requested time range. A well-chosen segmenting key and ordering key help skip batches. Too many tiny groups or a different query shape can erase that benefit. 00:02:01 A late reading changes an hourly summary The dashboard uses a continuous aggregate. A temperature of eight degrees arrives for ten twenty after its hour has already been summarized. The refresh policy determines when the dashboard catches up. The example starts with three hourly summaries and one late raw observation. Start offset 3 hours and end offset 1 hour, rounded to whole buckets. 10:00 is read again from raw rows. 11:00 is left alone. Combining sums of sixty, forty-eight and sixty-three with nine observations yields a daily average of nineteen degrees. Store enough information to combine groups correctly. Summing sums and counts can produce a weighted average; averaging already-rounded hourly averages generally cannot. 00:02:51 Keep a summary after raw rows expire The greenhouse promises a long history of hourly summaries and a shorter history of raw events. Retention and refresh are two separate background jobs that can undermine that promise if configured independently. Retention drops the raw chunk of day 1. The summary of day 1 stays. Someone refreshes the full history. Day 1 is recomputed from no rows. The example refreshes only the most recent eighty days while raw retention covers ninety. Older retained summaries stay outside that moving refresh window. Draw both windows on one time axis. Recompute where raw events still exist, choose what to do with unusually late data, and monitor the last successful run of each job.