perf(index): fetch the IVF and quantizer global buffers together on index open - #9378
Open
LuciferYang wants to merge 3 commits into
Open
LuciferYang wants to merge 3 commits into
LuciferYang wants to merge 3 commits into
Conversation
The v2 index load path awaited the IVF protobuf read before issuing the quantizer buffer read, two sequential round trips on every cold index open. Parse the quantizer metadata JSON first (schema metadata, no IO), then issue both global-buffer reads together with tokio::join. Assisted-by: GLM-5.3
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The two buffer positions are available before I/O, and the change now overlaps the required reads without changing their decoding or storage contracts. The focused regression test confirms that both cold reads are in flight together.
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.
Closes #9377
Opening an IVF index read the IVF protobuf, then parsed the quantizer metadata JSON, then read the quantizer's out-of-line buffer (the PQ codebook, the RaBitQ rotation). The second read never needed the first: its position comes from the schema metadata, which is in hand before either read starts. Parsing the JSON first makes both positions available, so the two reads now go out under one
try_join!and the storage waits once instead of twice.What that saves depends on the store. On a cold open against object storage it is one round trip, plus the overlap of two transfers that are megabytes each once the index has a few thousand partitions. On a warm local file it is nothing measurable. The reads themselves are unchanged, as is everything that happens with the bytes.
How was this patch tested?
test_storage_open_fetches_ivf_and_quantizer_buffers_togetherpins the property the change is about. Instantaneous reads never overlap no matter how they are issued, so the test wraps the object store to hold each read open for 25 ms and records how many are in flight, then opens the storage of an IVF_PQ index and asserts two. Restoring the sequential reads brings that back to one and fails the test.