cockroachdb / cockroachdb/cockroach

sql: support pgvector

Open
#121,432 0 comments 5 reactions 0 assignees View on GitHub
A-vector-index C-enhancement T-specialized-indexing
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The [`pgvector`](https://github.com/pgvector/pgvector) Postgres extension is a popular extension that adds support for vector similarity indexing and search.

This issue tracks adding support to CockroachDB.

Types
- [x] `vector` type
- [ ] `bit` type
- [ ] `halfvec` type
- [ ] `sparsevec` type

Operators
- [ ] `+` operator
- [ ] `-` operator
- [ ] `*` operator
- [ ] `||` operator (concatenate)
- [x] `<->` operator (l2 distance)
- [x] `<#>` operator (negative inner product)
- [x] `<=>` operator (cosine distance)
- [ ] `<+>` operator (taxicab/l1 distance)
- [ ] `<~>` operator (Hamming distance for `bit` type)
- [ ] `<%>` operator (Jaccard distance for `bit` type)

Builtin functions
- [x] `cosine_distance` function
- [x] `inner_product` function
- [x] `l2_distance` function
- [x] `l1_distance` function
- [ ] `l2_normalize` function
- [x] `vector_dims` function
- [x] `vector_norm` function
- [ ] `subvector` function
- [ ] `binary_quantize` function
- [ ] `hamming_distance` function
- [ ] `jaccard_distance` function
- [ ] `avg` aggregate function
- [ ] `sum` aggregate function
- [ ] `array_to_vector` function

Indexing
- [ ] `ivfflat` index
- [ ] `hnsw` index
- [ ] Acceleration of `<->`, `<#>` and `<=>` operators depending on which opclass is chosen at index creation time (`vector_l2_ops`, `vector_ip_ops`, `vector_cosine_ops`)

Configuration options
- [ ] `ivfflat.probes` - defines # of centroid lists to search during lookup

Jira issue: CRDB-37252

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.