Repository navigation
Add EXPLAIN PIPELINE option to compact repeated processor chains - #104662
Conversation
|
Workflow [PR], commit [f507e4e] Summary: ❌
AI ReviewSummaryThis PR adds an opt-in PR Metadata💡 The - Added the opt-in `EXPLAIN PIPELINE` setting `compact_repeated_processor_chains` to compact repeated processor chains in parallel join pipelines.Final VerdictStatus: ✅ Approve |
Fgrtue
left a comment
There was a problem hiding this comment.
Thank you for contribution! The solutions should be implemented in a different part of code -- we just want to see EXPLAIN slghtly different, not to change the way the pipeline is built.
Calculate processor graph layers in `IQueryPlanStep::describePipeline` so parallel processors are grouped for display without changing processor construction order.
ad060ec to
f9807f3
Compare
Fgrtue
left a comment
There was a problem hiding this comment.
This is a good approach. The result also looks good. However, we should add a setting that will control this behavior. This could be a setting in the EXPLAIN PIPELINE, that users could turn on and off if they want to. By default, let's turn if off by now. So the old tests don't need to be fixed. Also please add a new test, that will test this new setting.
Add `compact_repeated_processor_chains` for `EXPLAIN PIPELINE` so repeated processor chain rendering is opt-in for now. Keep the default output compatible with existing references and add a new stateless test for the enabled setting. Issue: ClickHouse#102998
@Fgrtue A new setting called EXPLAIN PIPELINE compact_repeated_processor_chains = 1
SELECT * FROM
(
SELECT * FROM system.numbers LIMIT 100000
) t1
ALL LEFT JOIN
(
SELECT * FROM system.numbers LIMIT 100000
) t2
USING number
SETTINGS max_threads=16; |
# Conflicts: # src/Processors/QueryPlan/IQueryPlanStep.cpp
Fgrtue
left a comment
There was a problem hiding this comment.
Good! Only one thing left -- documentation. Could you add it to the other settings for EXPLAIN PIPELINE in docs/en/sql-reference/statements/explain.md please?
|
@Fgrtue Documentation is updated, could you please check it out? Thanks. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 159/169 (94.08%) | Lost baseline coverage: none · Uncovered code |
|
The failed test Stress test (arm_debug) is unrelated to this PR and should be fixed by #106096, so I am merging this pull request. |
3087a92
|
Hi @niyue @Fgrtue — a couple of suggestions to make this PR easier for reviewers and the changelog reader. Title (currently
Ignore this if the current title/body is intentional. |
EXPLAIN PIPELINE option to compact repeated processor chains
Group right-side join processors by pipeline layer so
EXPLAIN PIPELINErenders parallelFillingRightJoinSideandSimpleSquashingTransformprocessors compactly instead of as an interleaved nested tower.Fixes #102998
Changelog category:
Changelog entry:
EXPLAIN PIPELINEoption to compact repeated processor chainsNote
Low Risk
Changes are limited to
EXPLAIN PIPELINEtext rendering and option plumbing (including distributed explain propagation), with no impact on query execution semantics.Overview
Adds a new
EXPLAIN PIPELINEboolean setting,compact_repeated_processor_chains, which detects adjacent repeated processor chains and prints them once with an aligned repetition marker (improving readability for parallel joins).Plumbs the option from
InterpreterExplainQuerythroughQueryPlan::ExplainPipelineOptionsandIQueryPlanStep::FormatSettings, and ensures it is forwarded when rendering distributed pipelines fromReadFromRemote. Documentation and a new stateless test cover the expected compacted output.Reviewed by Cursor Bugbot for commit 82cdb97. Bugbot is set up for automated code reviews on this repo. Configure here.
Version info
26.6.1.236