Repository navigation
fix(sql): enable leading-key pruning for distributed Top-K scans - #32261
Conversation
|
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: ab8674a87e76b2c9b6d2f7cb33b1ddf57d485d34
Assessment: approve
Leading-key pruning preserves full Top-K comparison and ties while reusing existing feedback mechanisms. Reader-owned ordering isolates shared data. No actionable defects found.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 13 changed paths, relevant owners and consumers, linked issue and complete discussion; source remained unchanged.
-
Protobuf descriptor audit and isolation preflight passed; receipts and terminal logs retained.
-
Frozen CI records 13 successful contexts, including build, unit tests and multi-CN BVT. Author reports focused race tests and controlled pruning comparisons.
Limitations:
-
Local reader test stopped before compilation because libmo.so was missing and native artifact reuse was rejected; no local product-test pass claimed.
-
Raw author validation logs were unavailable; the original production timeout was not reproduced.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32219.
What this PR does / why we need it:
Enable safe leading-key dynamic block pruning for multi-key Top-K scans, including remote execution. Preserve the full Top comparator and equal-leading-key candidates; do not extend single-key static reader limits or hidden-sort-key rewrites to multi-key ordering.
Carry TopValueTag and scan ordering through pipeline serialization. Remote readers own their block permutation and cloned, tightening threshold without mutating shared RelData. Keep unknown boundaries and conservatively fall back for unsupported mappings. Reject JSON and geometry-family leading keys for both single- and multi-key pruning: JSON semantic order differs from byte-ordered zonemaps, and geometry types lack a zonemap comparator. Preserve main's resident/spill Top paths, OrderedOutput, and ordered MergeTop/DOP boundaries. Protobuf bindings were regenerated from main's schema.
Validation on main (Go 1.27.1, Darwin/arm64 CPU):
This is the main-specific adaptation of #32242, not a blind cherry-pick. The original production 30-second timeout was not reproduced; these results do not establish its unique cause or guarantee production latency improvements.