timescale/pgvectorscale

Postgres extension for vector search (DiskANN), complements pgvector for performance and scale. Postgres OSS licensed.

What it solves

pgvectorscale is a PostgreSQL extension that improves the performance and storage efficiency of vector embedding searches. It complements pgvector by providing higher query throughput, lower latency, and more cost-effective storage for large-scale AI applications.

How it works

It introduces three primary technical innovations to PostgreSQL:

  1. StreamingDiskANN Index: A new index type inspired by the DiskANN algorithm that allows for efficient approximate nearest neighbor (ANN) searches.
  2. Statistical Binary Quantization (SBQ): A compression method developed by Timescale that reduces the storage footprint of vector data compared to standard binary quantization.
  3. Label-based Filtered Search: An implementation based on Filtered DiskANN research that allows users to combine vector similarity searches with metadata label filtering (using smallint[] arrays) for high-performance, precise results.

The extension is written in Rust using the PGRX framework, providing a modern alternative to the C-based pgvector.

Who it’s for

  • Application Developers: Who need to implement high-performance vector search within a PostgreSQL database.
  • Database Administrators (DBAs): Who want to optimize the cost and performance of vector workloads in their existing PostgreSQL environments.
  • Contributors: Developers interested in contributing to vector support in PostgreSQL using Rust.

Highlights

  • High Performance: Benchmarks show up to 28x lower p95 latency and 16x higher query throughput compared to Pinecone's storage-optimized index on large datasets.
  • Cost Efficiency: Reduces costs by up to 75% when self-hosted on AWS EC2.
  • Flexible Filtering: Supports both high-performance label-based filtering and arbitrary SQL WHERE clause post-filtering.
  • Tuning Capabilities: Offers both build-time parameters (e.g., num_neighbors, storage_layout) and query-time parameters (e.g., query_rescore) to balance accuracy and speed.

Related

  • Project
  • Project
  • Project
  • Project
  • Project