Repository navigation
[4.2-dev] Preserve block selectivity for prepared IN lookups - #32983
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 ↓. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
The code change looks sound to me. It restores prepared IN-list block selectivity through the existing runtime-constant predicate, while retaining the conservative rejection of lists containing column references. The same helper also serves join-filter deduction, so I checked that substituteMatchColumn does not need to rewrite anything inside the newly admitted lists. I did not find a correctness, design, or performance blocker in this change. There were no prior substantive review comments on this PR.
Validation on 81cd749d7848:
- The focused planner tests passed, including the new non-covering index / execution-type test and the empty, same-column, and other-column list cases. With only
utils.gooverlaid from the exact base, the new prepared-IN planner test failed as expected: it classified the parameter-list query as AP rather than TP. - An independent embedded-cluster MySQL-protocol probe exercised a prepared non-covering secondary-index lookup repeatedly with changing values, duplicates, NULLs, and misses, and checked join results with both a parameter list and a list containing a column. All expected rows matched. This checks result behavior; it is not a replacement for the author's large-table throughput measurement.
- The two
TestIssue32820*RestoreReconstructsAlterAncestorLineageassertions that failed in the first Ubuntu UT run passed when rerun in isolation on this head.
CI qualification: the first required Ubuntu UT run failed in multiple tests, including widespread cluster timeouts and the two restore assertions above. The isolated passes do not establish the cause of every CI failure. I restarted the failed checks; their result is still pending, so the required CI gate must pass or the remaining failures must be independently explained before merge. The author's end-to-end performance figures are single-run measurements and were not independently rerun on the original benchmark host.
❌ Left the queue ·
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32965
What this PR does / why we need it:
Prepared secondary-index lookups such as
k IN (?, …, ?)keep their parameters in an expression list. The column-reference check rejected this list, which inflated the estimated number of index blocks and classified the lookup as AP. This prevented reuse of its prepare-time physical compilation.Accept a nonempty list when every element is constant at execution time. Keep rejecting column-bearing lists because predicate substitution does not rewrite their contents. Add regression coverage for nested column references and for the execution type of prepared and literal lookups on a non-covering secondary index.
Validated on Linux with the full race-enabled unit suite, the additional catalog package, planner vet and incremental lint. The full standalone SQL suite in UTC passed all 108,941 active checks across 1,286 scripts (1,102 marked ignored). In a same-host 1,000-thread sysbench replay (one five-minute measurement per revision), throughput rose from 1,658 to 2,786 TPS and p95 fell from 1,352 to 847 ms. The pre-regression revision reached 2,720 TPS. All three runs returned identical rows for a fixed parameter set and reported zero execution errors.