Show ranges in explain indexes#79938
Merged
nickitat merged 9 commits intoClickHouse:masterfrom Jul 19, 2025
Merged
Conversation
Contributor
Member
Author
|
Interestingly, it can show fewer ranges than expected (like 1 range for 2 parts below) because of things like the query condition cache. I need to think about this a bit. |
Member
they could be disabled. |
Contributor
|
Dear @nickitat, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Contributor
Member
Author
|
@nickitat I finally found time to fix all the test outputs. The failure in 03352_concurrent_rename_alter looks unrelated. |
Merged
via the queue into
ClickHouse:master
with commit Jul 19, 2025
ab73363
120 of 123 checks passed
Member
|
Gentlemen, please don't forget to update the docs. Did that here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When investigating query performance, it can be very useful to see how many ranges ClickHouse will read from. Today, this is shown in a log line in
system.text_log, but we can have it earlier, before executing the query inEXPLAIN indexes = 1.For example, it is useful for a case like this where the number of granules to be read is almost the same, but the number of ranges is vastly different:
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Show the number of ranges to be read in the output of
EXPLAIN indexes = 1.