Skip to main content

Module index

Module index 

Source
Expand description

Vector index management for pgvector.

pgvector supports two approximate nearest-neighbor (ANN) index types:

IndexAlgorithmBest ForTradeoff
IVFFlatInverted file with flat quantizationLarge datasets, tunable recallRequires training data
HNSWHierarchical navigable small worldMost workloads, no training neededHigher memory usage

§Choosing an Index

  • HNSW is recommended for most use cases — better recall/speed tradeoff, no training step, and supports concurrent inserts.
  • IVFFlat is useful when memory is constrained or when you have very large datasets and can tolerate a training step.

Modules§

extension
SQL helpers for pgvector extension management.

Structs§

BinaryVectorIndex
A binary vector index definition.
BinaryVectorIndexBuilder
Builder for BinaryVectorIndex.
HnswConfig
Configuration for HNSW indexes.
IvfFlatConfig
Configuration for IVFFlat indexes.
VectorIndex
A vector index definition.
VectorIndexBuilder
Builder for VectorIndex.

Enums§

IndexType
The type of ANN index to create.