Repository navigation
fix(plan): avoid premature cross joins and correct semi-join coverage - #32833
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Queue requested — the merge queue status continues in this comment ↓. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 37a72bd205867cac56506c09cba2e44b3ef9db52
Assessment: approve
The changes preserve predicate availability and join boundaries while reusing existing overlap and primary-key rules for SEMI estimates across physical orientations. The bounded, query-local bookkeeping is justified; no actionable correctness or design issues remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Seven focused planner tests passed, including all changed roots and the existing 22-query TPC-H planning fixture.
-
The same selection against exact merge-base production sources failed for the intended dependency, premature-Cartesian and SEMI-bound defects; unchanged controls passed.
-
The complete planner suite passed (47.438s). EXPLAIN consumer tests and go vet also passed.
-
Isolation preflight, fresh native build, formatting, whitespace and native fingerprint checks passed. Tests used Go 1.27.1 and the assigned test-exec.
-
Command receipts, retained logs, discussion coverage and source identity were reconciled in validation-audit.json. Frozen source remains unchanged.
Limitations:
- Author-reported TPC-DS 1T timings, captured-fixture comparisons and 111-package static checks have no supplied raw receipts and were not independently rerun.
❌ Left the queue ·
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32806.
What this PR does / why we need it:
Fix two general planner mechanisms without query-specific rules, executor changes, or spill/budget changes:
Measured performance
Same-host TPC-DS 1T, one CN / 64 CPUs, unchanged original SQL and settings:
Q35 pairs were 63.260→33.160 s and, with service order reversed, 61.090→34.100 s. Both returned byte-identical outputs. Q4 matches the historical successful output byte-for-byte; the timed-out control has no complete result to compare. Q31/Q24/Q62/Q99 and Q10/Q23/Q69/Q78/Q83 also completed with equivalent results; these controls are not counted as additional established speedups.
Measurements used main
8e8708a8d3plus the respective unchanged patches before rebasing ontoe765c5fd44. Q35's parent already includes the Q4 fix. Settings:max_dop=0,agg_spill_mem=4GiB,join_spill_mem=0(automatic),sort_spill_mem=512MiB,GOGC=200, cgroup MemoryMax=192GiB/no swap, auto merge off. These are lab measurements, not a rerun of #32806's distinct 40GiB/automatic-spill configuration.Validation
After rebasing: the complete
pkg/sql/plantest package passes (60.56 s), including focused predicate-availability, dependency, SEMI coverage, PK-bound and physical-swap checks.All 103 TPC-DS statements and 22 TPC-H 1T captured-fixture plans build on both current main and this branch. Q4/Q31 conditionless INNER joins each go from 1 to 0; no new conditionless joins appear. All 22 TPC-H reachable operator, expression, join-orientation, shuffle and runtime-filter shapes remain unchanged after normalizing numeric estimates; Q4/Q21 derived block-count estimates differ. This is plan regression evidence, not a new native TPC-H timing claim.
Local incremental SCA passes on all 111 affected packages selected by the repository's verified Go production/test reverse-dependency graph. Pinned tools: molint
v0.0.0-20261115233300-147a3f213653, golangci-lint2.14.0; tests are included. Commands, withselectedcontaining that same package list:All exit 0 with no findings; gofmt and
git diff --checkalso pass.Only planner implementation and focused unit tests are included: 6 files, +229/-15 lines. Fixtures, benchmark data, scripts and experimental merge settings remain outside the PR.