How does pgvector handle vector dimensions and types?
RAG & Vector DB Interview: pgvector HNSW, IVFFlat, Index Tuning, Postgres RAG
Audio flashcard · 0:30Nortren·
How does pgvector handle vector dimensions and types?
0:30
pgvector supports three vector types: vector for dense float32, halfvec for float16 with half the memory, and bit for binary vectors. The dimension is declared in the column type like vector(1536) and is fixed per column. pgvector supports dimensions up to 2000 for HNSW indexes on vector types and up to 4000 for halfvec, with higher limits possible without indexing. Choose halfvec to halve memory when the accuracy loss from float16 is acceptable, and bit for binary-quantized vectors with Hamming distance.
github.com