Skip to main content

Decision brief

pgvector Review: Vector Search Inside Your Own Postgres

pgvector adds vector search to Postgres, free under the PostgreSQL License and offered by the major managed hosts. Test filtered queries against the planner and check your host's release before scale.

Reading time
4 min read
Sources
14 cited

GILD verdict

Start with pgvector when your application data already lives in Postgres and you want vectors in the same tables, transactions and backups.

Confirm the pgvector release your host ships, test filtered queries with EXPLAIN at production size, and enable iterative scans or partial indexes where filters are selective. Plan a move to a dedicated vector database only when selective filters and more than roughly 10 million vectors push the planner off your indexes, as Mem0 found.

pgvector

Vector Database by The pgvector project

−29 Negative
Product page

Fit and limits

Who it fits

  • Your data is in Postgres: pgvector stores your vectors with the rest of your data, and uses the write-ahead log for replication and point-in-time recovery.
  • You want exact search by default, with perfect recall, and HNSW or IVFFlat indexes when you trade some recall for speed.
  • Storage matters: half-precision and binary vectors shrink indexes, and Discourse reports index storage 32 times smaller with binary vectors and re-ranking (November 2025).
  • You use a managed Postgres: Neon, Supabase, Cloud SQL, Amazon RDS and Azure offer pgvector, each with its own version and enablement steps.

Where it falls short

  • With approximate indexes, filtering is applied after the index scan, and practitioners report the planner skipping an index under selective filters.
  • Index builds and maintenance cost memory: an HNSW build on a few million vectors can take 10+ GB of RAM, and a sparsevec index slowed inserts 38x after autovacuum until a fix in October 2026.
  • Hosts lag releases: a Digdir team reports Azure ships 0.8.2, with an HNSW vacuum bug fixed in 0.8.3, and one Azure user reports no support for the widest embeddings.
  • The project documents no single sign-on, audit log or certification, so check those controls with the Postgres host you choose.

Implementation reality

  1. Choose the host and release

    Check which pgvector release your Postgres host ships before you build. Cloud SQL lists 0.8.5 on PostgreSQL 13 and later, Neon lets you install the previous version, Amazon RDS needs PostgreSQL 15.2 or higher, and Azure needs pgvector on the server's allowlist.

  2. Pick index and vector types

    HNSW has better query performance than IVFFlat in its speed-recall tradeoff, at the cost of slower builds and more memory, and builds faster when the graph fits in maintenance_work_mem. Use halfvec for a smaller working set. HNSW indexes take vector up to 2,000 dimensions and halfvec up to 4,000.

  3. Test filtered queries

    Filtering applies after the index scan with approximate indexes. From 0.8.0, enable iterative index scans, and use partial indexes for low-cardinality filters. Check the plan with EXPLAIN on production-sized data, since the planner may choose a sequential scan.

  4. Plan upgrades and vacuum

    Pin the Docker tag and read the CHANGELOG before upgrading: 0.8.3 fixed possible HNSW index corruption during vacuuming, 0.8.7 fixed a buffer overflow in IVFFlat builds, and the unreleased 0.9.0 drops Postgres 13 and 14.

What to verify before you buy

Resource use

  • Storage: Each vector takes 4 * dimensions + 8 bytes of storage. Each half vector takes 2 * dimensions + 8 bytes.
  • Index builds: HNSW has better query performance than IVFFlat (in terms of speed-recall tradeoff) but slower build times and uses more memory. Indexes build significantly faster when the graph fits into maintenance_work_mem.
  • Scaling: Switch from vector to halfvec for a smaller working set, and scale vertically by increasing memory, CPU, and storage on a single instance.

Releases

  • Fixes: Version 0.8.7 (2026-10-01) fixed a buffer overflow with IVFFlat index build, and 0.8.3 (2026-06-17) fixed possible index corruption with HNSW vacuuming.
  • Postgres support: The unreleased 0.9.0 drops support for Postgres 13 and 14.

Limits

  • Indexed dimensions: HNSW indexes support vector up to 2,000 dimensions, halfvec up to 4,000 dimensions, bit up to 64,000 dimensions, and sparsevec up to 1,000 non-zero elements. IVFFlat indexes support vector, halfvec and bit at the same limits.
  • Stored vectors: A vector or half vector can have up to 16,000 dimensions, and a sparse vector up to 16,000 non-zero elements.
  • HNSW results: HNSW query results are limited by the size of the dynamic candidate list (hnsw.ef_search), 40 by default, and NULL vectors (and zero vectors for cosine distance) are not indexed.
  • Tables: A non-partitioned table has a limit of 32 TB by default in Postgres. A partitioned table can have thousands of partitions of that size.

Hosts and install

  • Neon: Neon allows installing the previous pgvector version, one version behind the latest it supports.
  • Azure: The extension name is vector, and it must be on the server's allowlist before it can be enabled.
  • Cloud SQL: PostgreSQL versions 13 and later support version 0.8.5, version 12 up to 0.7.4, and version 11 up to 0.5.1.
  • Windows: you build it with nmake or install it with Docker or conda-forge.

What to measure in your pilot

  • The managed hosts' pages GILD stored price nothing on pgvector itself; compare hosts on the Postgres instance a workload needs.
  • Public accounts put the ceiling anywhere from roughly 10 million vectors (Mem0) to past 100 million (one Hacker News commenter); measure your own latency under filters before choosing.
  • Which release carries the October 2026 sparsevec insert fix is not stated on the stored pages; check the CHANGELOG when you upgrade.

Sources

Official documentation
10
Public source
4
  1. pgvector on GitHub: READMEOfficial documentationraw.githubusercontent.com
  2. pgvector on GitHub: LICENSEOfficial documentationraw.githubusercontent.com
  3. pgvector on GitHub: META.jsonOfficial documentationraw.githubusercontent.com
  4. pgvector on GitHub: CHANGELOGOfficial documentationraw.githubusercontent.com
  5. pgvector on GitHub: SecurityOfficial documentationgithub.com
  6. Neon docs: The pgvector extensionOfficial documentationneon.com
  7. Microsoft Learn: pgvector on Azure Database for PostgreSQL flexible serverOfficial documentationlearn.microsoft.com
  8. Google Cloud: Cloud SQL for PostgreSQL extensionsOfficial documentationcloud.google.com
  9. AWS What's New: Amazon RDS for PostgreSQL supports pgvector (May 3, 2023)Official documentationaws.amazon.com
  10. Supabase docs: pgvectorOfficial documentationsupabase.com
  11. Mem0 blog: How we cut vector search latency by 70x (Jul 30, 2026)Public sourcemem0.ai
  12. Hacker News, xfalcox: pgvector at Discourse (Nov 3, 2025)Public sourcenews.ycombinator.com
  13. pgvector issue #1025: insert cost after VACUUM on a sparsevec HNSW index (Sep 10, 2026)Public sourcegithub.com
  14. digdir/genki issue #186: pgvector 0.8.2 on Azure and HNSW vacuum (Oct 29, 2026)Public sourcegithub.com