Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize IOPS for opening an index #2864

Open
wjones127 opened this issue Sep 11, 2024 · 0 comments
Open

Optimize IOPS for opening an index #2864

wjones127 opened this issue Sep 11, 2024 · 0 comments
Labels
performance rust Rust related tasks

Comments

@wjones127
Copy link
Contributor

When we open a vector index, we start by getting the tail of the file to load the version of the index.

let reader: Arc<dyn Reader> = self.object_store.open(&index_file).await?.into();
let tailing_bytes = read_last_block(reader.as_ref()).await?;
let (major_version, minor_version) = read_version(&tailing_bytes)?;

This requires two IOPS:

  1. Getting the size of the index file
  2. A range request for the end

We could optimize this by writing the size of the index file in the manifest, so we don't have to make the HEAD/metadata IOP to get the size. We could then pass the trailing_bytes down to the next step, in case it could be re-used. For example, in the V2 index path, we read the Lance file metadata next. It's possible this could be fully contained in those trailing bytes, and we could save another IOP.

Implementing this would reduce cold start latency for search queries.

These kinds of optimizations were already implemented for reading manifests: #2396

See also: #2420

@wjones127 wjones127 added rust Rust related tasks performance labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance rust Rust related tasks
Projects
None yet
Development

No branches or pull requests

1 participant