Repository navigation
Explain analyze - #106586
Explain analyze#106586
Conversation
|
Workflow [PR], commit [f3d226f] Summary: ❌
AI ReviewSummaryThis PR adds Findings❌ Blockers
Final Verdict❌ Changes requested. |
nickitat
left a comment
There was a problem hiding this comment.
I think it'd be valuable to split each step into more logical groups. In the sorting example, it might be "pre-sorting" and "final merge". For aggregation, it might be "pre-aggregation" and "final merge" again.
Also, I think it'd make sense to extend the time metrics. Usually, when I query processors_profile_log, I query min, median, max and sum for all processors with the same name. So, in theory, when you look at this profile, you want to be able to answer three questions: the single most expensive part of the plan, parallelism and the critical path. We should aim to provide enough information for that.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 743/830 (89.52%) · Uncovered code |
|
Reverting due to the failed assertion. |
|
Also, because you've merged it with failed tests: Which is a crime. |
…list The revert of #106586 removed the `ANALYZE`, `ESTIMATE`, and `TABLE OVERRIDE` bullets from the `EXPLAIN Types` overview list, but `ESTIMATE` and `TABLE OVERRIDE` are still advertised in the syntax block and still have their own `### EXPLAIN ESTIMATE` and `### EXPLAIN TABLE OVERRIDE` sections later in the same document. Re-add those two bullets (but not `ANALYZE`, which is removed by this revert) so the page is internally consistent again. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Revert "Explain analyze" (#106586)
Reintroduces the `EXPLAIN ANALYZE` feature (originally #106586) by reverting its revert #110162 (merge commit 178267d, reverted with `-m 1`). The feature was reverted only because of a `Logical error: 'clock'` abort in `EXPLAIN ANALYZE` over a streaming (`FROM ... STREAM`) read in debug and sanitizer builds. The following commit fixes that bug, so the feature can be reintroduced. This restores the query-executor instrumentation (`StepWallClock`, `StepWallClockRegistry`, `AnalyzePlanStats`, per-step wall-clock and per-port data accounting on `IProcessor`, per-stage processor grouping on `SortingStep`/`AggregatingStep`/`JoinStep`), the `ANALYZE` keyword and its handling in `ParserExplainQuery`/`InterpreterExplainQuery`, `StreamLocalLimits::forQueryResult`, and the associated tests and documentation. Related: #106586 Related: #110162 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This reverts the `EXPLAIN ANALYZE` feature added in ClickHouse#106586 (merge commit 918a0d3), a revert of that merge with `-m 1`. It removes the query-executor instrumentation (`StepWallClock`, `StepWallClockRegistry`, `AnalyzePlanStats`, per-step wall-clock and per-port data accounting on `IProcessor`, per-stage processor grouping on `SortingStep`/`AggregatingStep`/`JoinStep`), the `ANALYZE` keyword and its handling in `ParserExplainQuery`/`InterpreterExplainQuery`, `StreamLocalLimits::forQueryResult`, and the associated tests and documentation. There are no merged follow-up pull requests to revert. The only follow-up, ClickHouse#110077 ("Reject EXPLAIN ANALYZE for streaming (STREAM) queries"), is still open and not part of `master`. The single revert conflict, in `tests/queries/0_stateless/03269_explain_unique_ids.reference`, was resolved to keep the unrelated node-id renumbering introduced later by "Fix Not-ready Set exception by making in-place set build non-destructive" (5583c9a) while reverting only the `EXPLAIN ANALYZE` step-id change. Co-Authored-By: Claude Fable 5 <[email protected]>
|
@alexey-milovidov but I took the ownership of the issue here #109176 and did not merge my pull request until I was sure that the problem is resolved properly. In other words I did not leave CI in the state that it was when I was merging, making sure that the problem gets addressed by the person in whose interest it is to merge the pull request (me). Is this considered criminal behavior toward our CI? |
…wed-threadgroup-async-uaf-fix Conflict in src/Interpreters/InterpreterExplainQuery.cpp: master reverted the `EXPLAIN ANALYZE` feature in 93ee2f3 ("Revert 'Explain analyze'", PR ClickHouse#106586), removing the borrowed-`ThreadGroup` caller that our build fix added `createForExplainAnalyze` for. Followed the revert: took master's version of the file and dropped the now-orphaned `createForExplainAnalyze` factory.
`EXPLAIN ANALYZE` builds a `StepWallClockRegistry` and asserts (`chassert`) that every executing processor carrying a query-plan step has a matching wall clock. The registry is populated by walking the plan via `node->children` and `step->getChildPlans()`. When a join's right side is a dictionary (or `StorageJoin`) that must be scanned (`RIGHT`/`FULL JOIN`), the right-side reading plan is held inside the private `JoinStepLogicalLookup::child_plan` and its pipeline is built in `initializePipeline`. `JoinStepLogicalLookup` did not override `getChildPlans`, so the registry never descended into `child_plan`; the dictionary-reading processors then carried a step the registry never saw, `find` returned `nullptr`, and `chassert(clock)` aborted in debug/sanitizer builds (release silently skipped it). Override `JoinStepLogicalLookup::getChildPlans` to expose `child_plan`, mirroring `ReadFromMerge`. This registers the sub-plan's steps for wall-clock timing and makes the dictionary reading sub-plan visible in `EXPLAIN`. Neither pipeline building nor optimization route through the virtual `getChildPlans`, so there is no double build or re-optimization. The `FilledJoin`/`DirectKeyValueJoin` cases drop the lookup node from the plan tree, so their `EXPLAIN` output is unchanged. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106586&sha=63f54b5980fcd8cddb2ed80b37e1434a098eeee0&name_0=PR&name_1=Stress%20test%20%28arm_ubsan%29 Related: ClickHouse#106586 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Explain analyze
This reverts the `EXPLAIN ANALYZE` feature added in ClickHouse#106586 (merge commit 918a0d3), a revert of that merge with `-m 1`. It removes the query-executor instrumentation (`StepWallClock`, `StepWallClockRegistry`, `AnalyzePlanStats`, per-step wall-clock and per-port data accounting on `IProcessor`, per-stage processor grouping on `SortingStep`/`AggregatingStep`/`JoinStep`), the `ANALYZE` keyword and its handling in `ParserExplainQuery`/`InterpreterExplainQuery`, `StreamLocalLimits::forQueryResult`, and the associated tests and documentation. There are no merged follow-up pull requests to revert. The only follow-up, ClickHouse#110077 ("Reject EXPLAIN ANALYZE for streaming (STREAM) queries"), is still open and not part of `master`. The single revert conflict, in `tests/queries/0_stateless/03269_explain_unique_ids.reference`, was resolved to keep the unrelated node-id renumbering introduced later by "Fix Not-ready Set exception by making in-place set build non-destructive" (5583c9a) while reverting only the `EXPLAIN ANALYZE` step-id change. Co-Authored-By: Claude Fable 5 <[email protected]>
…list The revert of ClickHouse#106586 removed the `ANALYZE`, `ESTIMATE`, and `TABLE OVERRIDE` bullets from the `EXPLAIN Types` overview list, but `ESTIMATE` and `TABLE OVERRIDE` are still advertised in the syntax block and still have their own `### EXPLAIN ESTIMATE` and `### EXPLAIN TABLE OVERRIDE` sections later in the same document. Re-add those two bullets (but not `ANALYZE`, which is removed by this revert) so the page is internally consistent again. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…nalyze Revert "Explain analyze" (ClickHouse#106586)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Adding
EXPLAIN ANALYZEv1 for examination of query performance using metrics rendered in the familiar query plan format....
Version info
26.7.1.750(included in26.7and later)