cockroachdb / cockroachdb/cockroach
sql/vecindex: don't re-quantize input vector for each partition
- 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
Assessment
This issue has not been assessed yet.