Repository navigation
Add EXPLAIN PLAN fragments = 1 to print a stateless-worker plan per query fragment - #124893
Conversation
|
Workflow [PR], commit [fcf1c86] Summary: ✅
AI ReviewSummaryAdds Final Verdict✅ Approve. |
Manerone
left a comment
There was a problem hiding this comment.
I went though the code and so far everything makes sense. We refactor a bit the code for printing, we split the makeDistributed method, we take care of printing it in the correct Interpreter. I also asked Claude to review, and it found some issues which might be relevant.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes119 object files changed (+153.27 KiB total), 1 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units325 translation units recompiled, 2629 s compile time in total, 324 of them have a recent master baseline. |
…expression-length-bound Resolve the conflict in QueryPlanFormat.cpp: master's cut-plan fragment walk (ClickHouse#124893) is ported into the iterative buildPrettyNamesForNode as a stage between the children and the child plans, the same order as master's recursive walk. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #124179
Related: #124600
PR 2 of the fragment-aware
EXPLAINseries described in the RFC above. This PR makes FragmentGraphs visible to users for plans executed by stateless workers (make_distributed_plan = 1) using the newEXPLAIN PLAN fragments = 1.Changes
QueryPlan::cutIntoDistributedPlanis extracted fromconvertToDistributed: the decision checks, the extraction ofIN-subquery sets,makeDistributedPlan, thefinal_resultgather andassertFragmentSerializable. It returns aDistributedPlanCutand consumes the plan.convertToDistributedcalls it and then continues exactly as before, so execution is unchanged.FragmentGraphand rendered by the newexplainFragmentGraph. Each fragment is printed with the existingexplainPlanunder a header.EXPLAINprints without the option.INsubqueries are not shown yet: the plan names such a set (bid IN subquery1), but no fragment builds it. They come in PR 2b (see the RFC).fragmentswithjsonordistributedthrowsNOT_IMPLEMENTED.Example output for a broadcast join with aggregation:
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added
EXPLAIN PLAN fragments = 1, which prints a plan executed by stateless workers (make_distributed_plan = 1) as one plan per query fragment, with the exchanges between the fragments and their levels. On a query that is not distributed it prints the usual plan, followed by the fallback reason when the planner fell back to local execution.Workflow [PR]
Sync PR [sync-upstream/pr/124893]
Version info
26.11.1.659-master(included in26.11and later)