Skip to content

[Performance]: make FULLTEXT2 loaded UUID membership probes allocation-free and evaluate raw-16 zero-copy #27800

Open

Description

@VioletQwQ-0

Problem

PR #27248 removes boxing and re-encoding for loaded FULLTEXT2 primary keys whose docmap bytes already match the runtime-filter probe representation. UUID remains on the typed fallback because the docmap stores a 36-byte canonical string while docfilter hashes the raw 16-byte UUID.

The loaded UUID path currently converts docmap bytes to string, parses them into types.Uuid, passes through any, and then probes the runtime filter with the raw 16 bytes. This is a follow-up to #27247 and #27248; it must not expand the scope of #27248.

Stage P0: allocation-free UUID parse without a format change

  • Read canonical UUID bytes from the loaded docmap.
  • Parse from []byte directly instead of converting to string.
  • Reuse query-owned [16]byte scratch for the runtime-filter probe.
  • Remove loaded-path UUID boxing and type assertion.
  • Keep build-side segments on the current typed fallback.
  • Preserve malformed-input fail-closed behavior.

This stage must not change SQL, DDL, CDC, FST, index format, runtime-filter wire protocol, membership results, or score bits.

Stage P1: evaluate raw-16 true zero-copy

True zero-copy would store UUID as raw 16 bytes in the docmap so the loaded probe can borrow the mapped bytes directly. Do not implement this stage unless P0 still leaves UUID parsing as a material workload hotspot.

A P1 design must cover:

  • an explicit docmap/index-format version;
  • old-segment compatibility or safe fallback;
  • REINDEX/rebuild and migration behavior;
  • CDC, MERGE, restore, and mixed old/new segment handling;
  • runtime-filter hash-input compatibility.

Until those gates are satisfied, raw-16 persistence remains deferred.

Correctness and performance gates

  • Loaded UUID hit, miss, and mixed probes match the current path.
  • Malformed and truncated canonical UUID content fails safely.
  • Build-side behavior remains unchanged.
  • Membership results and math.Float32bits(score) remain identical.
  • P0 reaches zero steady-state allocations or improves loaded UUID ns/probe by at least 20%.
  • Benchmark hit/miss/mixed probes with GOMAXPROCS 1 and 10.
  • Advance to P1 only when a workload profile shows UUID membership parsing remains material after P0.

Non-goals

Activity

  1. self-assigned this
    on Aug 28, 2026
  2. added
    severity/s1
    on Sep 15, 2026
  3. XuPeng-SH commented on Oct 9, 2026

    @XuPeng-SH
    Contributor

    UUID 关联工作收敛说明:P0 已随 #28955 合并(5453d72b7372a9f77263d1dd4c982e616446d4cb),该提交是当前 main 的祖先。它复用 query-owned 16-byte scratch,消除 loaded UUID probe 的字符串转换/boxing,未改变持久化格式。

    原 issue 明确规定 P1 仅在 P0 后的真实工作负载 profile 仍显示 UUID 解析为显著热点时启动。目前没有新的符合该门槛的 workload evidence;本轮不实施 raw-16 持久化,也不声称 format version、旧 segment 兼容、REINDEX/CDC/MERGE/restore/migration 门槛已满足。

    因此 issue 保持开放,作为有条件的 P1 跟踪;P0 不再重复实现。#29805 的 SQL UUID_SHORT 与 FULLTEXT 存储路径相互独立,不改变该边界。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/performanceseverity/s1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions