Skip to content

perf(index): fetch the IVF and quantizer global buffers together on index open - #9378

Open
LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-concurrent-index-open
Open

LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-concurrent-index-open

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

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_together pins 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.

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
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer performance labels Sep 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer K-approved Latest Gatekeeper recommendation permits acceptance. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: opening an IVF index reads its two global buffers one after the other

1 participant