As reported by Sven, using the ht_metrics_partially_compressed table from tsbench:
explain (costs off) select * from _timescaledb_internal._hyper_41_787_chunk order by device, time limit 1;
QUERY PLAN
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Limit
-> Append
-> Custom Scan (DecompressChunk) on _hyper_41_787_chunk
-> Sort
Sort Key: compress_hyper_43_801_chunk.device, compress_hyper_43_801_chunk._ts_meta_sequence_num DESC
-> Seq Scan on compress_hyper_43_801_chunk
-> Sort
Sort Key: _hyper_41_787_chunk.device, _hyper_41_787_chunk."time"
-> Seq Scan on _hyper_41_787_chunk
The top-level sorting is wrong, because the plan should be MergeAppend. Apparently this never worked, reproduces both on the current 2.16.0-dev and on 2.12.
As reported by Sven, using the
ht_metrics_partially_compressed
table from tsbench:The top-level sorting is wrong, because the plan should be MergeAppend. Apparently this never worked, reproduces both on the current 2.16.0-dev and on 2.12.