Add condition cache query profiling#81
Open
peterxcli wants to merge 1 commit into
Open
Conversation
Signed-off-by: peterxcli <peterxcli@gmail.com>
dentiny
reviewed
Apr 23, 2026
dentiny
left a comment
Owner
There was a problem hiding this comment.
For this PR, should we have sql tests (with EXPLAIN ANALYZE)?
Collaborator
Author
yes, we already have it query II
EXPLAIN (ANALYZE, FORMAT JSON) SELECT count(*) FROM t WHERE id < 3000;
----
analyzed_plan <REGEX>:.*"Condition Cache": "MISS -> BUILT".*"Condition Cache Predicate Hash": "[0-9]+".*"Condition Cache Cached Row Groups": "5".*"Condition Cache Qualifying Vectors": "2/245".* |
Owner
|
Could you please paste the overall ANALYZE output in the PR description? |
dentiny
reviewed
Apr 24, 2026
| }; | ||
|
|
||
| struct ConditionCacheProfileInfo { | ||
| atomic<bool> initial_lookup_hit {false}; |
|
|
||
| struct ConditionCacheProfileInfo { | ||
| atomic<bool> initial_lookup_hit {false}; | ||
| atomic<bool> built_this_query {false}; |
Owner
There was a problem hiding this comment.
comment needed, also we should name the variable as noun_verb_ed
| idx_t total_row_groups; | ||
| }; | ||
|
|
||
| struct ConditionCacheProfileInfo { |
Owner
There was a problem hiding this comment.
comment needed, does the struct indicate a cache entry, singular/composite predicate, or a user query, a user connection
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.
Closes: #80
Introduce profiling, allowing cache status and statistics to be surfaced in
EXPLAIN ANALYZEoutput and JSON profiling.ConditionCacheProfileInfoto store profiling data (cache status, predicate hash, cached row groups, qualifying vectors, etc.) for each condition cache entry and propagate it through query planning and execution.QueryConditionCacheOptimizer) to create and attachConditionCacheProfileInfoto each cache entry, and propagate this information through the optimizer state and into the logical plan.ConditionCacheTableScanBindDatato wrap table scan bind data with profiling info, and updated the logical get node and filter binding to use and copy this profiling data.ConditionCacheDynamicToStringto surface cache profiling information inEXPLAIN ANALYZEand JSON profiling output, including status, predicate hash, and statistics.