Skip to content

Commit

Permalink
fix: populate index cache at the end of loading (#2123)
Browse files Browse the repository at this point in the history
  • Loading branch information
chebbyChefNEQ authored Mar 28, 2024
1 parent 951a95e commit 7e114ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions rust/lance/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ impl DatasetIndexInternalExt for Dataset {

async fn open_vector_index(&self, column: &str, uuid: &str) -> Result<Arc<dyn VectorIndex>> {
if let Some(index) = self.session.index_cache.get_vector(uuid) {
log::debug!("Found vector index in cache uuid: {}", uuid);
return Ok(index);
}

Expand Down
5 changes: 5 additions & 0 deletions rust/lance/src/index/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,10 @@ pub(crate) async fn open_vector_index_v2(
}
};

dataset
.session
.index_cache
.insert_vector(uuid, index.clone());

Ok(index)
}

0 comments on commit 7e114ee

Please sign in to comment.