Repository navigation
[4.2.1-hotfix] fix(plan): skip empty predicate deduction traversals - #31511
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? |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed f0426d0 against the actual hotfix base 47e644f. No blocking finding. The four guards remove empty deduction traversals while preserving normal child pushdown, residual handling and nonempty deductions; no unrelated changes from #26927 are included. Production net +8 lines; the 165 test lines provide deterministic complexity, direction/semantics and real PREPARE coverage.
Independently validated this hotfix with its own native libraries (Go 1.26.4, macOS arm64): 48 related planner tests / 87 subtests pass under -race; incremental golangci-lint 2.6.2 reports 0 issues. An actual three-CN embedded cluster passes 17 SQL scenarios in both direct and PREPARE/EXECUTE modes, plus invalid-PREPARE recovery. Reverting only production pushdown.go to base reproduces 509 visits for the eight-table/15-node regression.
Serial base/head/base PREPARE measurements for 16 INNER tables improve from 92–94ms and 138.5MiB allocated per operation to 0.37ms and 0.59MiB. Single-table and LEFT-chain controls show no stable regression. This addresses empty-deduction amplification, not a general planner memory budget.
CI caveat: Iceberg E2E job 122629279416 timed out during go build before SQL validation. Its log does not establish the underlying build stall cause; this approval does not claim that remote CI is all green.
7ce664f
into
matrixorigin:release/v4.2.1-hotfix-20261026
What type of PR is this?
Which issue(s) this PR fixes:
Related to #31502.
What this PR does / why we need it:
Minimally backport the non-empty predicate-deduction guards from main commit
5d6f921345(#26927). Skip the extra child traversal when no predicates were deduced, while preserving normal pushdown and non-empty deduction. No UPDATE alias, DEDUP, cancellation, or other changes from that PR are included.Add deterministic regression coverage for both chain directions and all six affected JOIN types, non-empty deduction semantics, and an eight-table PREPARE through the real planner entry point. The unpatched eight-table INNER chain performs 509 visits for 15 nodes; the guarded version performs 15. Independently reverting any of the four guards is caught by the regression.
Validation on this target branch (Go 1.26.4, macOS arm64, branch-local native libraries):
pkg/sql/plantests,go vet, and incremental golangci-lint 2.6.2 pass.This addresses empty-deduction traversal amplification, not a general planning-memory budget or a proof of linear planning cost for every SQL shape. No changes to main are included.