TLDR Web Dev · ARTICLES & TUTORIALS

SHARDING PGVECTOR

pgdog.dev8 min read

Summary from the TLDR Web Dev newsletter

Pgvector is a PostgreSQL extension for vector embeddings. PgDog scales `pgvector` by sharding the vector index. It distributes shards across multiple machines by using IVFFlat's existing vector space partitioning and K-means clustering, allowing for parallel queries based on proximity to centroids. This improves search performance, especially with larger datasets.