You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(fulltext2): probe loaded primary keys without boxing - #27248
FULLTEXT2 non-INCLUDE WHERE filtering probes a primary-key runtime membership filter for candidate documents. Loaded segments already hold immutable canonical PK content bytes in their mmap-backed docmap, but the previous path decoded each key into a boxed Go value and encoded it again for docfilter.
This PR probes the loaded docmap content directly when its representation matches the runtime-filter source vector:
integer, BIT, temporal, decimal, and ordinary varlena PKs use the borrowed loaded path;
build-side segments retain the typed fallback;
UUID retains the typed fallback because docmap stores a 36-byte canonical string while docfilter hashes the raw 16-byte value;
malformed loaded PK metadata fails closed without falling through to another representation.
There is no SQL, DDL, index-format, FST, CDC, runtime-filter wire-protocol, score, or public-interface change.
Review closure
TestLoadedContainsPkTypes uses the production Builder -> Finish -> Serialize -> Deserialize chain and asserts the resulting segment is loaded (pks == nil). It now also records the actual slice passed to MembershipFilter.Test:
every non-empty, non-UUID probe must share the exact backing memory returned by loaded pkContent, proving the borrowed path rather than merely byte-equivalent decode/re-encode;
UUID must be an independent 16-byte probe and must not alias the 36-byte canonical docmap content;
BVT: N/A — this changes the representation and allocation behavior inside the existing membership probe without changing SQL-visible membership or score semantics. The equivalent deterministic regression crosses the production segment serialization/loading boundary, builds a real runtime-vector membership payload, and invokes the production loaded-segment membership entry point. Existing FULLTEXT2 BVT behavior is unchanged.
Historical 2.3M-document directional evidence
The earlier shared-host paired run completed 36/36 cells with zero errors and zero timeouts:
Workload
Candidate / baseline QPS
Baseline P99
Candidate P99
non-INCLUDE 0.1%, C10
1.310x
204.23 ms
156.02 ms
non-INCLUDE 1%, C10
1.288x
238.86 ms
185.69 ms
non-INCLUDE 10%, C10
1.115x
420.13 ms
374.51 ms
no-WHERE control, C10
0.997x
46.49 ms
46.92 ms
Microbenchmarks reduced loaded BIGINT probe allocation from 6 B/op to 0 and loaded VARCHAR from 40 B/op / 2 allocs/op to 0.
These are historical directional results from a busy shared host (PERF_INCONCLUSIVE_HOST_BUSY), not current-head absolute QPS/P99 publication data.
QA
QA required: yes
Production entry point: non-INCLUDE FULLTEXT2 WHERE filtering using PK runtime membership on loaded segments.
Automated terminal coverage: serialized loaded segments, runtime-vector payloads, all supported PK representations, malformed metadata, ordinal bounds, and UUID/build-side fallback.
Remaining gate: fresh exact-head CI and renewed reviewer confirmation.
Thanks for the follow-up review. The loaded-path test already used the production Builder -> Finish -> Serialize -> Deserialize chain, but its byte-copy oracle could not distinguish true borrowing from decode-and-reencode. The new exact-head test now also asserts loaded.pks == nil and checks backing-memory identity: every non-empty non-UUID slice passed to MembershipFilter.Test must alias the loaded pkContent/pkRaw storage. UUID is the intentional control and must instead be an independent raw 16-byte probe, not the 36-byte canonical docmap content. Build-side fallback and malformed loaded metadata remain covered. UUID allocation-free parsing and conditional raw-16 storage are tracked separately in #27800 and are not mixed into this PR. Fresh local package, table-function, focused/full race, build, vet, diff-check, and semantic-preflight validation passed on head 13673ea381.
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
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #27247
What this PR does / why we need it:
FULLTEXT2 non-INCLUDE
WHEREfiltering probes a primary-key runtime membership filter for candidate documents. Loaded segments already hold immutable canonical PK content bytes in their mmap-backed docmap, but the previous path decoded each key into a boxed Go value and encoded it again fordocfilter.This PR probes the loaded docmap content directly when its representation matches the runtime-filter source vector:
docfilterhashes the raw 16-byte value;There is no SQL, DDL, index-format, FST, CDC, runtime-filter wire-protocol, score, or public-interface change.
Review closure
TestLoadedContainsPkTypesuses the productionBuilder -> Finish -> Serialize -> Deserializechain and asserts the resulting segment is loaded (pks == nil). It now also records the actual slice passed toMembershipFilter.Test:pkContent, proving the borrowed path rather than merely byte-equivalent decode/re-encode;UUID allocation-free parsing and a conditional raw-16 on-disk design are intentionally out of scope and tracked in #27800.
Exact-head validation
Base:
matrixorigin/matrixone@b7892451b3d3df7ca998d45a215d07b20c415ecbHead:
13673ea3812433e8d70dfdf845b1b120d169797fPassed locally on macOS/arm64 with current-branch MatrixOne CGo prerequisites:
BVT: N/A — this changes the representation and allocation behavior inside the existing membership probe without changing SQL-visible membership or score semantics. The equivalent deterministic regression crosses the production segment serialization/loading boundary, builds a real runtime-vector membership payload, and invokes the production loaded-segment membership entry point. Existing FULLTEXT2 BVT behavior is unchanged.
Historical 2.3M-document directional evidence
The earlier shared-host paired run completed 36/36 cells with zero errors and zero timeouts:
Microbenchmarks reduced loaded BIGINT probe allocation from 6 B/op to 0 and loaded VARCHAR from 40 B/op / 2 allocs/op to 0.
These are historical directional results from a busy shared host (
PERF_INCONCLUSIVE_HOST_BUSY), not current-head absolute QPS/P99 publication data.QA
QA required: yes
WHEREfiltering using PK runtime membership on loaded segments.