Primary key analysis for _part_offset#58224
Primary key analysis for _part_offset#58224alexey-milovidov merged 3 commits intoClickHouse:masterfrom
Conversation
|
This is an automated comment for commit 66660ee with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
d15e78b to
66660ee
Compare
|
Nice. |
|
Is it possible to use this feature directly as a secondary index, with or without projections? I don't see any documentation for these virtual columns, but it sounds like they might be useful for making some queries faster. |
You don't need any secondary index for this, it works just out-of-the box.
Yes, if you know the exact offset in the part you can optimize the query, but, ClickHouse already applies such optimizations internally based on primary and secondary indexes, you don't need to do this explicitly |
Can it be made possible to store which could recalculate on merges and enable transforming a query like into (using the same table snapshot for the inner select) Is such a thing doable? I think there are a few things that need to work
Am I making any sense? My hope is that rather than doing an O(n) scan through secondary index marks (even if the constant factor is low due to high |
|
@EmeraldShift Oh this is a well-timed FR. I'm currently finalizing plans to contribute this feature in the coming days. |
|
Wonderful! I look forward to reading your plans, and I'm happy to experiment with it and see how it fits in with my use case! |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
The primary key analysis in MergeTree tables will now be applied to predicates that include the virtual column
_part_offset(optionally with_part). This feature can serve as a poor man's secondary index.