cockroachdb / cockroachdb/cockroach

sql/vecindex: don't re-quantize input vector for each partition

Open
#152,097 0 comments 0 reactions 1 assignee Claimed by @KAmbekar View on GitHub
A-vector-index C-enhancement C-performance P-3 T-specialized-indexing
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The `RaBitQuantizer.EstimateDistances` method is called once for each searched partition, which can be 100's of times for a nearest-neighbor search. Each time it's called, the method will re-quantize the input vector.

This can be improved by introducing a new `QuantizedQuery` type that creates a partition-independent quantized representation that can be reused across partitions. This approach was taken in the [RaBitQ-Library](https://github.com/VectorDB-NTU/RaBitQ-Library) (see `split_single_estdist` and `SplitSingleQuery`).

NOTE: before doing this work, verify that it will have a measurable impact on macro scenarios. It's possible that CPU profiles will be dominated by other work.

Jira issue: CRDB-53643

Epic CRDB-63810

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.