EXPLAIN SELECT DISTINCT ON (ts) ts, ts - lag(ts) OVER (ORDER BY ts) AS interval FROM _materialized_hypertable_5 WHERE ts >= '2024-04-08 14:00:00+00'::timestamptz ORDER BY ts ASC; Unique (cost=26274.01..53269992.90 rows=6 width=24) -> WindowAgg (cost=26274.01..51996108.57 rows=509553731 width=24) -> Custom Scan (ChunkAppend) on _materialized_hypertable_5 (cost=26274.01..43078918.28 rows=509553731 width=8) Order: _materialized_hypertable_5.ts -> Custom Scan (DecompressChunk) on _hyper_5_60_chunk (cost=26274.01..22977240.64 rows=180537000 width=8) Filter: (ts >= '2024-04-08 14:00:00+00'::timestamp with time zone) -> Sort (cost=26262.03..26713.37 rows=180537 width=52) Sort Key: compress_hyper_6_77_chunk._ts_meta_min_1 -> Seq Scan on compress_hyper_6_77_chunk (cost=0.00..10499.40 rows=180537 width=52) Filter: (_ts_meta_max_1 >= '2024-04-08 14:00:00+00'::timestamp with time zone) -> Custom Scan (DecompressChunk) on _hyper_5_68_chunk (cost=17970.32..16471313.54 rows=131351000 width=8) Filter: (ts >= '2024-04-08 14:00:00+00'::timestamp with time zone) -> Sort (cost=17959.74..18288.11 rows=131351 width=52) Sort Key: compress_hyper_6_87_chunk._ts_meta_min_1 -> Seq Scan on compress_hyper_6_87_chunk (cost=0.00..6792.89 rows=131351 width=52) Filter: (_ts_meta_max_1 >= '2024-04-08 14:00:00+00'::timestamp with time zone) -> Index Only Scan Backward using _hyper_5_79_chunk__materialized_hypertable_5_ts_idx on _hyper_5_79_chunk (cost=0.57..2573380.89 rows=140114207 width=8) Index Cond: (ts >= '2024-04-08 14:00:00+00'::timestamp with time zone) -> Index Only Scan Backward using _hyper_5_89_chunk__materialized_hypertable_5_ts_idx on _hyper_5_89_chunk (cost=0.44..1056983.21 rows=57551524 width=8) Index Cond: (ts >= '2024-04-08 14:00:00+00'::timestamp with time zone) (20 rows)