perf(publication): reduce materialization persistence latency - #443
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
suguanYang
marked this pull request as ready for review
September 28, 2026 13:42
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.
Summary
This draft PR optimizes Knowhere publication/materialization persistence for the production-shaped document workload.
Changes
KNOWHERE_PUBLICATION_STRATEGY=baseline|candidateswitch.Evidence
On the Mac mini, using a PostgreSQL 15 clone with 170,280 chunks, 107,032 map units, and more than 12 million existing token rows:
The classic retrieval token-selective and frequency queries both use
idx_document_map_unit_tokens_token_lookup_binaryaccording toEXPLAIN (ANALYZE, BUFFERS)on the production-shaped Mac clone.These are production-shaped local measurements, not a production latency guarantee.
Validation
Passed:
git diff --check.Known local test limitation:
JobStateAuditLogSQLAlchemy mapper registration problem during API lifespan setup. The failures occur before the retrieval assertions execute.Rollout status
This is intentionally a draft PR.
baseline.Rollback
Set
KNOWHERE_PUBLICATION_STRATEGY=baselineto return application publication behavior to the baseline path. The index migrations have downgrade paths; no production schema mutation is included in this PR.DevOps rollout item
Tracked separately in Issue #444.
KNOWHERE_PUBLICATION_STRATEGYto API and Worker deployment configuration.baselinethrough migration and readiness checks.candidateglobally only after the operational gates pass.KNOWHERE_PUBLICATION_STRATEGY=baselineand restarting API/Worker.