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): avoid boxing loaded primary keys for runtime-filter probes #27247
FULLTEXT2 non-INCLUDE WHERE filtering probes a primary-key runtime membership filter for every candidate document. On a loaded segment, the current path decodes the mmap-backed docmap key into a boxed Go value and then encodes it again for docfilter.
This adds avoidable allocation and CPU cost on a hot candidate-filtering path, especially for variable-length primary keys.
Proposed scope
Probe immutable loaded-segment docmap PK content bytes directly when their representation matches the runtime-filter source vector.
Keep build-side segments on the existing typed fallback.
Keep UUID on the typed fallback because the docmap stores its canonical string while docfilter hashes the raw 16-byte representation.
Preserve SQL results, score bits, runtime-filter behavior, index format, DDL, CDC, and public interfaces.
Correctness requirements
Prove byte-representation compatibility for all supported integer, temporal, decimal, BIT, and varlena PK types.
Preserve bounds checks and the UUID/build-side fallback.
Keep PK membership and float32 score bits identical to the existing path.
Directional evidence
On the shared mo-55 host, the existing 2,303,643-row paired run completed 36/36 cells with zero errors and zero timeouts:
Workload
Candidate / baseline QPS
non-INCLUDE 0.1%, C10
1.310x
non-INCLUDE 1%, C10
1.288x
non-INCLUDE 10%, C10
1.115x
no-WHERE control, C10
0.997x
Microbenchmarks reduced loaded BIGINT probe allocations from 6 B/op to 0 and loaded VARCHAR from 40 B/op / 2 allocs/op to 0.
The host was shared, so these ratios are directional paired evidence; absolute QPS and P99 are not publication-grade.
The current matrixorigin/matrixone:main head at handoff is 3155f22bdabcecd48802f244d9fb0717b99f9b6d.
Required PR CI on the merged head was green, including Ubuntu/x86 UT, Linux/arm64 SCA, coverage, Compose, Standalone, and shared build checks (run 33271574738). The non-required TKE check-in BVT job 99154116448 timed out after 75 minutes and is not treated as a PASS.
Automated terminal coverage includes the production Builder -> Finish -> Serialize -> Deserialize loaded-segment path, borrowed PK-content membership probes for supported non-UUID representations, UUID/build-side typed fallbacks, malformed metadata, invalid ordinals, missing offsets, truncation, invalid lengths, and empty varlena content.
Remaining QA scenarios: run the non-INCLUDE FULLTEXT2 WHERE membership path on the current main build with loaded segments, verify SQL rows and score bits remain unchanged, confirm no regression in UUID/build-side fallback and malformed-input fail-closed behavior, and measure the loaded-path allocation/performance effect in the deployed environment.
Expected result: loaded probes preserve membership semantics while avoiding the boxed decode/re-encode path; all fallback and boundary cases remain correct.
Tester selection: the issue author is VioletQwQ-0, not heni02; therefore the required tester is Ariznawlll.
Activity
perf(fulltext2): probe loaded primary keys without boxing (#27248)
VioletQwQ-0 commentedon Aug 30, 2026
QA handoff after PR #27248 merge
Issue #27247 remains open and is transferred to testing.
dda7ec2045501a6bb6c4d5984ccd7e81da1f8c82at2026-08-29T19:43:16Zwith merge commita3f1328612563cce6bc6cddaeddc8a3813bc6bb1.matrixorigin/matrixone:mainhead at handoff is3155f22bdabcecd48802f244d9fb0717b99f9b6d.33271574738). The non-required TKE check-in BVT job99154116448timed out after 75 minutes and is not treated as a PASS.Builder -> Finish -> Serialize -> Deserializeloaded-segment path, borrowed PK-content membership probes for supported non-UUID representations, UUID/build-side typed fallbacks, malformed metadata, invalid ordinals, missing offsets, truncation, invalid lengths, and empty varlena content.WHEREmembership path on the current main build with loaded segments, verify SQL rows and score bits remain unchanged, confirm no regression in UUID/build-side fallback and malformed-input fail-closed behavior, and measure the loaded-path allocation/performance effect in the deployed environment.VioletQwQ-0, notheni02; therefore the required tester isAriznawlll.perf(fulltext2): probe loaded primary keys without boxing (matrixorig…
perf(fulltext2): probe loaded primary keys without boxing (matrixorig…
perf(fulltext2): probe loaded primary keys without boxing (matrixorig…
Ariznawlll commentedon Sep 18, 2026
在 latest main
d9609d742b9000b54279f44e34295630b7238282完成复测后,此 issue 暂不关闭并转回研发处理测试断言。已完成的验证:
go test ./pkg/fulltext2 -count=1通过。-race -count=10运行当前确定性的 loaded-PK/UUID 覆盖:TestLoadedContainsPkTypes、TestLoadedContainsPkNoAlloc、TestLoadedContainsPkBoxingCounterexample、TestPkContentRejectsInvalidAccess、TestLoadedUUIDMembershipRepresentations、TestLoadedUUIDMembershipMixed、TestLoadedUUIDMembershipRejectsMalformedRows、TestLoadedUUIDMembershipRejectsInvalidAccess、TestLoadedUUIDMembershipLivenessScoreAndStream、TestLoadedUUIDMembershipParallelOwners,均通过。BenchmarkLoadedUUIDMembership连续 5 次结果中,pointer-backed UUID hit/miss/mixed 均为0 B/op, 0 allocs/op;inline-copy 对照组仍为16 B/op, 1 alloc/op,符合本修复要消除 boxing 的目标。阻塞项在遗留测试本身,而非已确认的功能回归:将
TestContainsPkTypes/uuid一并纳入全包-race时,会在 ordinal=1 的非成员 UUID 上断言false,但实际得到true。UUID 的非整数 PK 路径使用近似 Bloom filter,允许 false positive;pkg/common/docfilter/filter.go也将该路径标记为 non-exact。当前较新的pkg/fulltext2/uuid_membership_test.go已正确区分这一点:表示层测试允许 Bloom 命中,确定性 miss 则使用 exactuuidSetMembershipFilter。请将旧的
TestContainsPkTypes/uuid改为不把任意 Bloom 非成员当作确定 miss,或改用 exact filter/原始字节断言来验证。修改后请重新跑完整go test -race ./pkg/fulltext2。MOTR #186 中的 SQL 可见性回归可作为补充,但不能替代这个 package race gate。Ariznawlll commentedon Nov 2, 2026
结论
测试通过。本次补充验证了 FULLTEXT2 非 INCLUDE 条件下主键过滤的结果一致性,并复核了此前阻塞整包 race 的测试断言;相关回归已纳入 MOTR。
关键证据
main@ea184ad90624ae3dba8ced628ac019271a6c309c的单机 1 CN / 1 TN 环境。更新的 main 为87fe4e0c3ac3f9a98b308f8931fd3f8be345b076,两者之间未变更 FULLTEXT2、docfilter 及相关 CGo 源码。go test -race -count=1 ./pkg/fulltext2在上述版本及更新的87fe4e0c3ac3f9a98b308f8931fd3f8be345b076均通过;最新版本耗时 138.579 秒,包含旧TestContainsPkTypes和 loaded segment、异常输入、UUID 回退等覆盖。最新版本首次尝试因本机动态库搜索路径缺失未进入测试,补齐路径后通过。待解决点
无本 issue 已知待解决项。本次未重新运行原有 230 万行部署环境性能测试,其共享机器上的性能比值仅作为方向性参考。