Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong order for direct select from a single partially compressed chunk #7084

Open
akuzm opened this issue Jul 1, 2024 · 0 comments
Open

Comments

@akuzm
Copy link
Member

akuzm commented Jul 1, 2024

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.

@akuzm akuzm changed the title wrong order for direct select from partially compressed chunk wrong order for direct select from a single partially compressed chunk Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant