-
Notifications
You must be signed in to change notification settings - Fork 837
feat: add cost to explain pruning stats #19015
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
feat: add cost to explain pruning stats #19015
Conversation
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.
Pull request overview
This PR adds cost tracking to the explain pruning statistics feature, controlled by a new session setting explain_pruner_cost. The implementation measures the time spent in different pruning phases (segment range, block range, bloom filter, inverted index, and vector index) and displays this information in EXPLAIN ANALYZE output.
- Introduces a
PruningCostControllerthat uses RAII guards to measure pruning costs - Adds timing measurements for all pruning operations (segments and blocks)
- Extends the
PruningStatisticsstruct to include cost fields (in microseconds) - Adds formatting support to display costs in explain output
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/query/storages/fuse/src/pruning/pruning_statistics.rs | Adds PruningCostController, PruningCostGuard, and cost tracking fields to FusePruningStatistics |
| src/query/storages/fuse/src/pruning/segment_pruner.rs | Integrates cost measurement for segment range pruning |
| src/query/storages/fuse/src/pruning/block_pruner.rs | Integrates cost measurement for block range, bloom, and inverted index pruning |
| src/query/storages/fuse/src/pruning/vector_index_pruner.rs | Integrates cost measurement for vector index pruning |
| src/query/storages/fuse/src/pruning/fuse_pruner.rs | Collects cost statistics and populates the PruningStatistics structure |
| src/query/storages/fuse/src/pruning/mod.rs | Exports new cost controller types |
| src/query/settings/src/settings_default.rs | Adds explain_pruner_cost setting (default: 0) |
| src/query/settings/src/settings_getter_setter.rs | Adds getter for explain_pruner_cost setting |
| src/query/sql/src/planner/planner.rs | Extends QueryKind::Explain to include ExplainAnalyze |
| src/query/service/src/physical_plans/format/common.rs | Adds cost suffix formatting for pruning statistics display |
| src/query/catalog/src/plan/pruning_statistics.rs | Extends PruningStatistics with cost fields and backward-compatible serialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
86c741a to
2474668
Compare
Co-authored-by: Copilot <[email protected]>
2474668 to
d9a46e9
Compare
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Tests
Type of change
This change is