Repository navigation
Conversation
XuPeng-SH
force-pushed
the
agent/fix-binary-index-prefix-residual
branch
from
August 9, 2026 02:50
5581c38 to
4e65479
Compare
XuPeng-SH
marked this pull request as ready for review
August 9, 2026 03:16
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? |
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
Fixes matrixorigin#26807. ## What changed - Retain the original typed residual predicate for `CHAR`/`VARCHAR`/`BINARY`/`VARBINARY` `=` and `IN` lookups that use a `serial_full` secondary-index prefix candidate. - Keep the encoded prefix predicate for candidate pruning, then apply exact SQL comparison semantics after `serial_extract`. - Add planner unit coverage and a BVT matrix covering empty bytes, NUL prefixes, embedded NULs, fixed/variable binary widths, textual byte strings, prepared parameters, NULL, composite-index order, backfill, indexed UPDATEs, and hidden physical-index cardinality. - Use a physically index-free mirror table as the textual scan oracle, so the regression cannot pass accidentally if an `IGNORE INDEX` hint is not honored. ## Root cause The encoded `prefix_eq`/`prefix_in` condition is a candidate range, not an exact semantic oracle for byte-string values: the tuple terminator can prefix an escaped embedded NUL. Covering index-only plans removed the original typed predicate and therefore returned false-positive rows. The fix preserves an exact residual only for affected byte-string point predicates; range and fixed-width numeric paths remain unchanged. ## Validation - Pre-fix real-engine counterexample on an index-free oracle: `VARCHAR '='` returned `2` through the covering index vs `1` by scan; `IN` returned `3` vs `2`. - Focused planner counterexamples for `BINARY`, `VARBINARY`, `CHAR`, and `VARCHAR`, with range and `INT64` controls. - Complete CGo `pkg/sql/plan` tests. - `go build` and `go vet` for `./pkg/sql/plan`. - `make build-with-prebuilt-native`. - Isolated candidate-cluster BVT: 95/95 statements passed. - `git diff --check` and a complete pre-push self-review passed. No partitioned-table behavior is involved.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
Fixes matrixorigin#26807. ## What changed - Retain the original typed residual predicate for `CHAR`/`VARCHAR`/`BINARY`/`VARBINARY` `=` and `IN` lookups that use a `serial_full` secondary-index prefix candidate. - Keep the encoded prefix predicate for candidate pruning, then apply exact SQL comparison semantics after `serial_extract`. - Add planner unit coverage and a BVT matrix covering empty bytes, NUL prefixes, embedded NULs, fixed/variable binary widths, textual byte strings, prepared parameters, NULL, composite-index order, backfill, indexed UPDATEs, and hidden physical-index cardinality. - Use a physically index-free mirror table as the textual scan oracle, so the regression cannot pass accidentally if an `IGNORE INDEX` hint is not honored. ## Root cause The encoded `prefix_eq`/`prefix_in` condition is a candidate range, not an exact semantic oracle for byte-string values: the tuple terminator can prefix an escaped embedded NUL. Covering index-only plans removed the original typed predicate and therefore returned false-positive rows. The fix preserves an exact residual only for affected byte-string point predicates; range and fixed-width numeric paths remain unchanged. ## Validation - Pre-fix real-engine counterexample on an index-free oracle: `VARCHAR '='` returned `2` through the covering index vs `1` by scan; `IN` returned `3` vs `2`. - Focused planner counterexamples for `BINARY`, `VARBINARY`, `CHAR`, and `VARCHAR`, with range and `INT64` controls. - Complete CGo `pkg/sql/plan` tests. - `go build` and `go vet` for `./pkg/sql/plan`. - `make build-with-prebuilt-native`. - Isolated candidate-cluster BVT: 95/95 statements passed. - `git diff --check` and a complete pre-push self-review passed. No partitioned-table behavior is involved.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
Fixes matrixorigin#26807. ## What changed - Retain the original typed residual predicate for `CHAR`/`VARCHAR`/`BINARY`/`VARBINARY` `=` and `IN` lookups that use a `serial_full` secondary-index prefix candidate. - Keep the encoded prefix predicate for candidate pruning, then apply exact SQL comparison semantics after `serial_extract`. - Add planner unit coverage and a BVT matrix covering empty bytes, NUL prefixes, embedded NULs, fixed/variable binary widths, textual byte strings, prepared parameters, NULL, composite-index order, backfill, indexed UPDATEs, and hidden physical-index cardinality. - Use a physically index-free mirror table as the textual scan oracle, so the regression cannot pass accidentally if an `IGNORE INDEX` hint is not honored. ## Root cause The encoded `prefix_eq`/`prefix_in` condition is a candidate range, not an exact semantic oracle for byte-string values: the tuple terminator can prefix an escaped embedded NUL. Covering index-only plans removed the original typed predicate and therefore returned false-positive rows. The fix preserves an exact residual only for affected byte-string point predicates; range and fixed-width numeric paths remain unchanged. ## Validation - Pre-fix real-engine counterexample on an index-free oracle: `VARCHAR '='` returned `2` through the covering index vs `1` by scan; `IN` returned `3` vs `2`. - Focused planner counterexamples for `BINARY`, `VARBINARY`, `CHAR`, and `VARCHAR`, with range and `INT64` controls. - Complete CGo `pkg/sql/plan` tests. - `go build` and `go vet` for `./pkg/sql/plan`. - `make build-with-prebuilt-native`. - Isolated candidate-cluster BVT: 95/95 statements passed. - `git diff --check` and a complete pre-push self-review passed. No partitioned-table behavior is involved.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #26807.
What changed
CHAR/VARCHAR/BINARY/VARBINARY=andINlookups that use aserial_fullsecondary-index prefix candidate.serial_extract.IGNORE INDEXhint is not honored.Root cause
The encoded
prefix_eq/prefix_incondition is a candidate range, not an exact semantic oracle for byte-string values: the tuple terminator can prefix an escaped embedded NUL. Covering index-only plans removed the original typed predicate and therefore returned false-positive rows. The fix preserves an exact residual only for affected byte-string point predicates; range and fixed-width numeric paths remain unchanged.Validation
VARCHAR '='returned2through the covering index vs1by scan;INreturned3vs2.BINARY,VARBINARY,CHAR, andVARCHAR, with range andINT64controls.pkg/sql/plantests.go buildandgo vetfor./pkg/sql/plan.make build-with-prebuilt-native.git diff --checkand a complete pre-push self-review passed.No partitioned-table behavior is involved.