Repository navigation
[4.2-dev] Avoid SQL literal expansion for exact IVF PRE - #33551
Conversation
PR Summary by QodoPass exact IVF PRE keys as typed parameters, not SQL literals
AI Description
Merge Risk
|
|
This pull request is merged. |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand |
|
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: f1cdc4b552378fd679ed0720674ce7d0fdea9548
Assessment: approve
The change preserves exact membership before Top-K while replacing wide-key SQL literal expansion with bounded, typed key payloads. It reuses the existing executor and filtering paths; the added per-chunk matcher and scans carry a cost, but the tested wide-key workload improved substantially. The automated review’s possible nil-payload concern is not supported: Rows is nil-safe and the required-filter path distinguishes an empty domain from an unavailable payload.
Model: gpt-6.1-terra / max
Session: 01a22b07-00b6-7e32-b0a1-3099d0b867c7 · slot 1 · generation 39
Validation:
-
Preflight and native-input provenance audit passed; receipts 1796090409350465087-3.json and 1796090435532280299-4.json.
-
Focused planner, matcher, hashbuild, IVF search and SQL executor tests passed; targeted race tests also passed. Receipts 1796090691685460882-3.json and 1796091578421982011-3.json.
-
Public SQL probes passed for multiple primary-key types and a two-CN wide-key domain crossing the byte budget. A separate SQL probe verified the added binary-key, INCLUDE, OFFSET and empty-domain results against a relational control. Receipts 1796090888841004253-3.json and 1796091652092611898-3.json.
-
Equal-fixture performance probes against the target base reconstructed with a Go overlay and the candidate passed. Median PRE times for 8,192 and 8,193 wide keys fell from approximately 242 and 247 ms to 37 and 39 ms, respectively. Receipts 1796091122107008325-3.json and 1796091169501837309-3.json.
Limitations:
-
The supplied evidence had no completed CI result or normal mo-tester comparison for the entire changed BVT case. The added SQL results were independently exercised through the SQL frontend.
-
The performance comparison used one run per revision with four timed samples per case; it supports the observed improvement for that fixture, not a precise general performance estimate.
What type of PR is this?
Which issue(s) this PR fixes:
issue #33549
What this PR does / why we need it:
#33514 established exact IVF PRE membership before ranking. On wide VARCHAR primary keys, it also expanded complete typed key vectors into SQL literals and ran the optimizer and entries scan for every list of literals. The optimizer accounted for 54% of sampled CPU in the 8,193-key reproduction. The inner executor also returned all matching entries before the Go merge took the Top-K.
Validation
Local Linux amd64 measurements against
34b63d7261, two runs per side, eight timed samples per mode and key count per run. Each query returned the expected Top-10. Values are ranges of the run medians in milliseconds.FORCE remained in the 1.4–2.0 ms range. With persisted 48,000-row controls, the 2-key BIGINT median was 1.58–2.07 vs 1.59–1.61 ms. The 2-key VARCHAR median was 1.57–1.72 vs 1.73–1.92 ms, with overlapping sample ranges. The 100-key BIGINT and VARCHAR controls retained block pruning and the 5,000-key integer control retained docfilter.