Repository navigation
perf(plan): skip equal-value ODKU fulltext rebuilds - #28066
mergify[bot] merged 5 commits into
Conversation
800668b to
4706825
Compare
4706825 to
8840d24
Compare
8840d24 to
d890f3b
Compare
|
Addressed the current-head CR findings in
Validation on the exact published head:
Please re-review this exact head. |
6586207 to
12374e8
Compare
|
Follow-up for the current head
Please review the current head, especially the rebase integration between the upstream physical-change marker and the per-index value-change sources. |
|
Update for current head
Please review the current diff; CI is running on this new head. |
|
Follow-up for the exact-base head The branch was rebased onto current target Validation on this exact-base head: focused fulltext/plugin and indexplugin plan tests pass with race and repeated execution; semantic preflight PASS; local planner CGo-transitive validation remains unavailable because |
|
Follow-up for the current exact-base head The branch was rebased onto current target Validation on this exact-base head: focused fulltext/plugin and indexplugin plan tests pass with race and repeated execution; focused vet and diff-check pass; semantic preflight PASS with diff hash Please review this current head; CI is running for the new history. |
|
Maintenance update for exact head |
|
Current-head review status for PR #28066: live head The current head already contains the confirmed repairs for three review items: design revision 3 documents the versioned planner/plugin contract, including hidden-index identity, PK/doc-id preconditions, failure semantics, bounds, and rollout; the FULLTEXT hook returns the PK/doc-id identity column before supported text inputs and ODKU rejects possibly changed primary keys; and planner tests use an injected resolver instead of mutating the process-global registry. Exact-head validation passed for the focused tests, The remaining formal-review blocker is still open: exact-head A/B evidence for equal, changed, mixed, multi-index, and long-TEXT assignments, including a changed-heavy regression bound, is not available. Earlier measurements were from different commits/workloads and are not being reused. No external benchmark was started because this isolated worktree has no safely matched baseline/runtime. Review remains |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-reviewed cc8f653 against merge-base 6e5f82f.
The earlier design/identity/test-isolation findings are addressed: the versioned design explains the hidden-state proof and fallback, FULLTEXT includes PK/doc identity, and injected resolvers avoid process-global registry mutation. I also checked logical-group closure, old versus final values, generated dependencies, NULL transitions, source fan-out, and non-ODKU callers. No additional confirmed correctness blocker emerged from this pass.
[P2] The performance acceptance criterion remains open. This is a performance PR, but the exact-head evidence still does not measure assignments such as body = VALUES(body) with equal-value conflicts, or quantify the changed-heavy overhead of the extra comparisons and per-index materialized branches. CI and plan-shape tests do not establish that benefit or bound. The author's latest update explicitly confirms the same outstanding item; the earlier unrelated-column workload is not a substitute.
Please attach a reproducible baseline/head A/B (same dataset/environment, recorded SHAs and repeated measurements) covering equal, changed, mixed new/duplicate rows, independent indexes, and long TEXT. Report elapsed time and CPU/memory where available, correctness checks for base rows and postings/search results, and an explicit acceptable changed-heavy regression bound. Update the PR's stale validation section. This does not call for further abstraction or code churn unless the measurements identify a regression.
Executed on this exact head: controlled macOS CGo tests for pkg/fulltext/plugin/plan and pkg/indexplugin/plan with -race -count=2, and focused ODKU/irregular-index planner tests with -count=2: PASS. git diff --check: PASS. Native artifacts were reused only after verifying matching CGo/native dependency sources. No end-to-end performance A/B was executed in this review. Request changes is retained solely for the outstanding performance evidence.
aunjgr
left a comment
There was a problem hiding this comment.
Review of commit cc8f6537c05c3da59042e0d4fad0928902b2d4e8.
[design gate] docs/design/20260906-odku-fulltext-maintenance.md remains 'Review required'. The new optional DMLMaintenanceNoOpHook establishes a proof contract across the generic planner and index plugins: equality of the selected old/final columns must imply identical persisted posting input, including document identity. This architectural contract needs an independent design decision before implementation approval. Please record approval of contract revision R3 and its implementation conformance, including the conservative unsupported-type fallback and validation evidence. This review is stopped at the design gate and does not assert a new posting-correctness defect.
Evidence: source review and existing passing CI for this commit; no new local test run was performed for this review.
|
CR follow-up for exact head I completed the requested production-entry A/B on the exact current parent/head pair. Both builds used the same deterministic customer-shaped schema, 600,000 base rows, 4,200,000 measured FULLTEXT postings, 1,000-row real multi-row
The plan-shape evidence is also exact-head: parent has only the old-row-id filter; head has Correctness checks after the changed/mixed/long sequence: 600,500 rows, 599,000 The focused planner/plugin tests, exact-head semantic preflight, build, and |
aptend
left a comment
There was a problem hiding this comment.
Deep re-review completed on exact head 0b52ec8b3eb6c112f9379e4ecab047138e86e6d8.
I read the complete review/comment history, author replies, and both resolved threads, then compared the previously reviewed cc8f6537c05c3da59042e0d4fad0928902b2d4e8 series with the current base/head. The four implementation patches are range-diff equivalent after the rebase; the substantive new evidence is the requested exact-parent/head performance matrix.
The earlier blockers are closed:
- I independently reviewed and approve design contract R3. It defines the hidden-state identity invariant, ODKU-only PK precondition, conservative failure behavior, per-logical-index fan-out bound, and rollback path.
- FULLTEXT’s proof includes the PK/doc identity plus every indexed part; only byte-exact
VARCHAR/TEXTcomparisons opt in, while unsupported types, missing metadata/plugins/hooks, and incomplete physical groups retain the rebuild path. - The final stored row image produces one marker per affected logical index. Both stale-entry deletion and re-tokenization consume the same
isNewRow OR valueChangedderivative, while unaffected indexes receive only new rows and non-opting indexes retain the physical-change fallback. - Planner tests use an injected scoped resolver and no longer mutate the process-global plugin registry.
The exact-head A/B now covers equal, changed, mixed, long-TEXT, and independent-index cases with raw repeated samples and correctness checks. Equal and mixed conflicts improve; the disclosed long-TEXT and independent-index overheads (1.43x and 1.50x) stay within the recorded 1.5x/2.0x bounds. This is sufficient mechanism evidence for the optimization; matching customer-topology QA remains appropriately called out rather than claimed.
Validation on this exact head:
- focused planner/FULLTEXT cases passed under
-race -count=100; - full
./pkg/sql/plan ./pkg/fulltext/plugin/plan ./pkg/indexplugin/planpassed normally and under-race; go vetpassed for those owning packages;git diff --checkis clean, and current CI/UT/BVT summary is green.
I found no blocking correctness, lifecycle, or performance-contract issue in the current change.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Approve exact head 0b52ec8 against bcd5ed8. No concrete remaining blocker found.
I verified that all four implementation commits are range-diff equivalent to the previously reviewed cc8f653 series. The last XuPeng-SH review retained changes solely for the missing performance acceptance matrix; this head now has that matrix, and aptend has independently approved design contract R3 at this head. I reviewed that contract and its conservative proof/fallback rather than treating the document's older “Review required” label as an unresolved runtime defect.
Source checks: the FULLTEXT hook includes PK/doc identity and all indexed parts; ODKU enforces immutable PKs. VARCHAR/TEXT NULL-safe equality currently uses bytes.Equal, so the selected proof really implies the same tokenizer input; CHAR/JSON/DATALINK remain excluded. Generated-column dependency closure is used when identifying affected groups. The marker compares old and final stored values, and both delete and insert maintenance select the same per-logical-index new-or-changed derivative. Unsupported groups retain their fallback; unaffected indexes keep their new-row source. Source-specific delete-PK pruning, grouped physical definitions, statement-local state and non-ODKU callers were checked. No new global cache, asynchronous owner, wire format, or transaction protocol is introduced. The scoped resolver tests avoid the prior process-global registration/repetition defect.
Performance acceptance is workload-specific, not a claim of universal improvement. The attached repeated samples improve equal-text conflicts (0.07s -> 0.05s median) and mixed rows (0.25s -> 0.14s), but show real disclosed regressions for long TEXT (0.74s -> 1.06s, 1.43x) and two independent indexes (0.04s -> 0.06s, 1.50x). These fit the recorded, independently reviewed 1.5x/2.0x bounds. I accept that bounded tradeoff for this optimization; it must remain visible to rollout/QA and must not be described as speeding up every FULLTEXT workload. The short synthetic samples do not establish customer 12-minute workload performance.
Evidence reused: exact-head CI run 34082458122 passes UT, SCA, coverage, shared build and proxy/pessimistic multi-CN BVT; the current-head review also records focused race repetition plus owning planner/plugin normal/race/vet passes. Reviewed UT/BVT coverage for NULL transitions, equal/changed/mixed rows, grouped and independent indexes, unsupported hooks/types, invalid marker positions and generated dependencies. No local full-suite or customer-topology performance run was performed in this review, and no source was modified.
aunjgr
left a comment
There was a problem hiding this comment.
Review of commit 0b52ec8b3eb6c112f9379e4ecab047138e86e6d8.
The prior design gate is closed: aptend explicitly approved contract R3 on this commit. I checked the conservative hook and source wiring: the FULLTEXT proof includes PK/document identity and every indexed part, uses the final stored row image, and routes both deletion and insertion through the same per-index new-or-changed source. Unsupported types/plugins retain the existing maintenance path. The disclosed long-TEXT and independent-index costs are accepted tradeoffs within the recorded bounds, not a universal speedup claim. The document's stale 'Review required' label should be synchronized with the approval record; it is not an additional blocker.
Evidence: source review and existing passing CI/validation evidence. No new local test run was performed for this review.
Merge Queue Status
This pull request spent 1 hour 12 minutes 7 seconds in the queue, including 1 hour 11 minutes 45 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #27933
What this PR does / why we need it:
This PR optimizes classic synchronous FULLTEXT ODKU when the final stored indexed value is equal to the old value. The planner keeps new rows on the tokenizer/insert path, but routes equal-value conflict rows away from hidden FULLTEXT scan/delete/re-tokenization. The proof is conservative and opt-in:
VARCHARandTEXTare supported;CHAR,JSON,DATALINK, FULLTEXT2, IVF and unknown plugins keep the existing maintenance path. Changed indexed text is intentionally not claimed as optimized by this PR.The implementation is based on the exact current
mainbasebcd5ed833b5400fe95f322e4028adb2bde3de0a4and head0b52ec8b3eb6c112f9379e4ecab047138e86e6d8. Exact committed diff hash:7ff9a2f763995c64a9f2ab6927d5d7ebc5d24f23e27df4fc3cdd88c6d7985674.Validation:
git diff --checkpasses;PASS semantic=PASS(manifest/private/tmp/mo-preflight/28066-0b52-manifest.json);INSERT ... ON DUPLICATE KEY UPDATE, equal/changed/mixed/long-text and two-independent-FULLTEXT cases.Local paired synthetic measurements on the same host and deterministic schema (seconds, three samples after warmup; each build used a fresh instance):
chunk_text=VALUES(chunk_text))system.statement_inforecordsrows_read=1000for the ODKU samples. The plan-shape differential is explicit: parent keeps only the old-row-id filter, while this PR addsold_rowid IS NULL OR valueChangedbefore irregular-index maintenance. The equal-text median is 0.71x parent; changed-text is 0.78x and mixed is 0.56x. Long-TEXT is 1.43x and the two-index case is 1.50x in this small local run; these are the measured changed-heavy comparison overheads, not hidden PASS claims. The proposed acceptance bound is <=1.5x for the long-text case and <=2.0x for independent-index fan-out, while equal and mixed conflict cases must improve; the recorded samples meet those bounds.Candidate correctness after the long-text run: 600,500 rows, 599,000
hellomatches, 1,000longmatches, 4,519,000 postings, and zero duplicate(doc_id, word, pos)rows. The two-index samples also retainrows_read=1000andbytes_scan=84000insystem.statement_info.The large probe uses the customer-shaped
VECF32(1536)column withembedding=NULLto avoid measuring vector parsing; it is local synthetic evidence, not confirmation of the customer deployment topology or the customer's 12-minute workload. QA required: yes. Please rerun the exact-head BVT/CI and review the paired performance evidence before merge.