Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

pg_vectorsearch: Open Source PostgreSQL Extension for Vector Search

Tiger Data has released pg_vectorsearch, an open source PostgreSQL extension for vector similarity search, currently in alpha, enabling faster and more memory-efficient vector search directly in PostgreSQL.

Share
AI-generated conceptual illustration accompanying: pg_vectorsearch: Open Source PostgreSQL Extension for Vector Search
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Introduction and Key Features of pg_vectorsearch

Tiger Data has released pg_vectorsearch, an open source PostgreSQL extension for vector similarity search, currently in alpha. According to the authors, pg_vectorsearch enables faster, more memory-efficient vector search directly in PostgreSQL, reducing the infrastructure required to handle large vector datasets. The extension supports existing pgvector columns, allowing applications to perform vector search without a separate database. This advancement aims to simplify the integration of vector search capabilities into PostgreSQL-based applications, potentially lowering costs and improving performance for organizations managing large-scale vector data.

Technical Implementation and Performance Benchmarks

The technical implementation of pg_vectorsearch introduces the PRISM index, which requires developers to install the extension and create an index using the CREATE INDEX ON documents USING prism (embedding vec32_l2_ops); command. According to Tiger Data’s benchmarks, PRISM demonstrated significantly improved performance compared to HNSW, building an index on 100 million vectors in 1 hour and 40 minutes on a machine with 128 GB of memory, while HNSW required 42 hours on a machine with 512 GB of memory. Erik Nordström, Matvey Arye, and Noah Hein from Tiger Data explain that PRISM employs a partition-based approach, akin to newer dedicated vector search systems. This design reduces index size and minimizes costly random memory or disk access, enabling faster vector search with less RAM directly within PostgreSQL.

Index Construction and Optimization Techniques

The index construction in pg_vectorsearch employs hierarchical clustering to narrow the search space, compressed vectors for efficient sequential scanning, and RaBitQ quantization to reduce expensive distance calculations InfoQ. To improve recall, vectors near partition boundaries are duplicated, and the index leverages PostgreSQL’s native storage, logging, and concurrency mechanisms InfoQ. According to Freedman on LinkedIn InfoQ, incremental rebalancing is not yet fully implemented, meaning frequent data changes may require rebuilding the index to maintain search efficiency. These techniques aim to enhance scalability and performance for vector search within PostgreSQL, though ongoing development is necessary to address dynamic data scenarios.

Community and Industry Reactions

In the wake of the pg_vectorsearch release, the open source community and industry professionals have expressed a mix of enthusiasm and caution. On Hacker News, users highlight the potential for more scalable and cost-effective vector search within PostgreSQL, particularly for those working on RAG (Retrieval-Augmented Generation) applications with limited resources. Hermon Hagos notes that the development makes vector search 'cheaper,' which could be a significant advantage for developers building on a single database and tight budget.

However, practitioners also raise concerns. They question whether independent benchmarking has been conducted to validate performance claims, whether pg_vectorsearch could replace existing tools like pgvectorscale, and whether the new extension supports filtered searches. These concerns underscore the need for further testing and transparency from the project maintainers.

Limitations and Current Constraints

The current implementation of pg_vectorsearch introduces several limitations that affect its scalability and functionality. According to the developers, support for on-demand splitting of oversized posting lists is limited to flat indexes, with more complex rebalancing operations such as merging and reassignment still under development InfoQ. Additionally, filtered vector searches that combine WHERE and ORDER BY clauses are not yet supported, restricting the ability to perform complex query operations until general availability InfoQ. While benchmarking efforts by Tiger Data suggest performance improvements using pgvector’s 16-bit halfvec for HNSW, these results are based on internal testing and have not been independently validated InfoQ. These constraints highlight the ongoing work required to fully realize the potential of vector search within PostgreSQL.

Sources and reporting notes

Based on published source material. No independent hands-on testing is claimed.

Read more