-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add experimental support for descending sorting keys in MergeTree tables #71095
Conversation
This is an automated comment for commit 663d26e 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
|
52d1398
to
aea4036
Compare
aea4036
to
f8437fc
Compare
204fd5b
@@ -202,6 +202,7 @@ namespace ErrorCodes | |||
DECLARE(String, storage_policy, "default", "Name of storage disk policy", 0) \ | |||
DECLARE(String, disk, "", "Name of storage disk. Can be specified instead of storage policy.", 0) \ | |||
DECLARE(Bool, allow_nullable_key, false, "Allow Nullable types as primary keys.", 0) \ | |||
DECLARE(Bool, allow_experimental_reverse_key, false, "Allow descending sorting key in MergeTree tables (experimental feature).", 0) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mark the setting as EXPERIMENTAL
in the flags (the 0 at the end). Otherwise it's not experimental, just it has a different name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to need validation in the code
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20241213) * Fix build due to ClickHouse/ClickHouse#71095 --------- Co-authored-by: kyligence-git <[email protected]> Co-authored-by: Chang Chen <[email protected]>
It does not give any speedup: |
Although, there is good speedup when I read a small number of columns. |
Are you using this query to verify?
You can try adding non-primary key filters that cannot be satisfied by the last few granules alone (e.g., filters that result in fewer than 10 matches). |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
This PR introduces a new setting
allow_experimental_reverse_key
that enables support for descending sort order in MergeTree sorting keys. This is useful for time series analysis, especially TopN queries. Example usage:Some preliminary perf test:
Documentation entry for user-facing changes
CI Settings (Only check the boxes if you know what you are doing):