Pinecone's pg_pinecone filters during vector search: 136 MB index vs 2 GB for HNSW, by its own benchmark


Pinecone announced pg_pinecone, an open source PostgreSQL extension that adds vector search to existing pgvector columns without a Pinecone account. InfoQ’s write-up (Nov 29) summarizes Pinecone’s own blog post. The performance figures below are Pinecone’s benchmarks and, per that write-up, have not been independently verified yet.

The write-up says pgvector’s HNSW index (a graph-based approach) applies filters after retrieving the nearest neighbors. With a highly selective filter, most of those candidates get discarded. The query can then return fewer rows than requested, or need additional scans that increase latency and may reduce accuracy.

What pg_pinecone does differently

Its native engine uses two techniques:

  • IVF clusters similar vectors, so a search reads contiguous memory pages rather than traversing graph nodes.
  • RaBitQ compresses vectors to roughly one bit per dimension, plus correction values.

It applies the filter during the search, not after. It stores the value of one filter column next to each row’s RaBitQ code, and at build time counts how many rows carry each value. It then picks a strategy based on selectivity. The extension runs entirely within the local PostgreSQL database.

The numbers Pinecone reports

  • With 10% of rows matching a filter, the native engine uses single-stage filtering and reaches 1.000 recall in 12.3 ms. HNSW with iterative scans reaches 0.920 recall at best, in 5.9 ms.
  • On one million 768-dimensional vectors, Pinecone reports a 136 MB index, compared with 2 GB for pgvector HNSW using half-precision vectors.

Read the first pair carefully: HNSW was faster (5.9 ms vs 12.3 ms) but returned less (0.920 recall vs 1.000). The trade is latency for completeness on filtered queries.

Other details

It also supports existing pgvector indexes, and has an optional remote engine that offloads search to Pinecone’s managed service without changes to SQL queries. The project is on GitHub under the Apache 2.0 license. InfoQ lists other options in the same space, including TensorChord’s VectorChord and Tiger Data’s pg_vectorsearch.

Limits

  • The benchmarks are the vendor’s own, and the write-up says they haven’t been independently verified.
  • One commenter asked how recall and latency behave when tenant sizes vary a lot, which the write-up leaves open.
  • The filtering described works on one filter column per index, as the write-up puts it (“one filter column next to each row’s RaBitQ code”). Queries filtering on several columns aren’t covered.
  • The write-up doesn’t say what hardware or Postgres settings produced the numbers.

What I’d take from it

If you run pgvector with selective filters, such as per-tenant queries, the thing to test on your own data is recall at your real filter selectivity, not only latency. Pinecone’s numbers give you a hypothesis to check.

This post summarizes a secondary write-up of Pinecone’s post. I haven’t run the extension myself.