Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 5 min read Release mediumAdept

What's new in pgvector v0.7.0

pgvector 0.7.0 adds float16 (halfvec), sparse and bit vector types to exploit redundancy in embeddings and cut memory and storage. Halfvec halves both table and HNSW index size (3.5GB vs 7GB for 900K 1536-dim OpenAI vectors) and builds parallel HNSW indexes about 30% faster, with Jonathan Katz's benchmarks showing up to 3x faster builds at essentially unchanged recall and QPS. Binary quantization with Hamming-distance HNSW indexes enables a fast pre-select followed by exact re-ranking on a small subset, with limit sizes tuned per dataset. The release also adds L1, Hamming and Jaccard distance operators and index opclasses.

Related posts

  • Don’t use vector. Use halvec instead and save 50% of your storage cost

    Neon mediumAdept

    pgvector 0.7's half-precision halfvec type stores embedding components as 16-bit floats instead of 32-bit, cutting table and HNSW index storage nearly in half. On a 1M-row, 1536-dimension DBpedia dataset on an 8 CPU Neon Postgres instance (HNSW m=32, ef_construction=256), it also reduced index build time by 23% and prewarming time by 50%, with equivalent query latency and recall. Binary quantization shrinks vectors 32x and speeds index builds, but its recall on 1536-dimension embeddings was too low for production. The recommendation is to prefer halfvec over vector after testing on your own data.

  • pgvector v0.5.0: Faster semantic search with HNSW indexes

    Supabase mediumAdept

    pgvector v0.5.0 adds HNSW indexes, which combine skip-list-style layering with navigable small world proximity graphs to do approximate nearest-neighbor search over embeddings. In Supabase benchmarks on 1536-dimension OpenAI vectors, HNSW delivered about 3x the QPS of IVFFlat on 224K vectors and over 6x on 1M vectors at equal accuracy. Tuning ef_search, m and ef_construction trades speed against recall; raising ef_construction to 80 reached 0.99 accuracy@10 with ef_search 100 and 35% more QPS. HNSW can be built on an empty table and stays optimal as data arrives, but it builds more slowly and uses more memory than IVFFlat, whose build times dropped over 50% thanks to parallel list assignment and float-based FMA distance math.

  • 20x faster than pgvector: introducing pg_embedding extension for vector search in Postgres and LangChain

    Neon mediumAdept

    pg_embedding brought HNSW graph-based approximate nearest neighbor indexing to Postgres. On the GIST-960 dataset (1M 960-dim vectors, k=100, 4 vCPU/16 GB), it ran 5–30x faster than pgvector's IVFFlat at equal recall. IVFFlat needs more probes to raise recall and drifts toward a sequential scan, while HNSW's layered graph gives roughly logarithmic search. HNSW trades higher memory use, slower index builds (driven by efConstruction) and L2-only distance for that speed. Neon has since deprecated pg_embedding in favor of pgvector, which now supports HNSW natively.

  • Understanding vector search and HNSW index with pgvector

    Neon mediumAdept

    pgvector 0.5.0 adds an HNSW (Hierarchical Navigable Small Worlds) index for approximate nearest neighbor search in Postgres, replacing O(N) sequential exact scans with a multi-layer graph traversal that trades a little accuracy for much faster queries. A walkthrough covers vector embeddings, L2 and cosine distance with worked examples, and pgvector SQL for storing and querying vectors with the <=> operator. Index tuning hinges on m (graph degree), ef_construction (build-time candidate list) and ef_search (query-time beam size): higher values improve recall at the cost of build time, memory or query latency. HNSW is faster and higher-recall than IVF but resource-intensive to build, often requiring more RAM and a larger maintenance_work_mem.

  • pgvector 0.6.0: 30x faster with parallel index builds

    Supabase mediumAdept

    pgvector 0.6.0 adds parallel HNSW index builds, cutting build time for 1M 1536-dimension vectors (dbpedia OpenAI dataset, m=16, ef_construction=200) from about 1h27m to 9.5 minutes. Benchmarks show 7-9x speedups on a 16-core instance and up to 13.5x on 64 cores, with no change in recall (0.963) or QPS. Scaling is not linear in core count, so max_parallel_maintenance_workers is best set to about CPU count / 2. Building on unlogged tables skips the non-parallelizable WAL write and pushes speedups to 23-31x, which suits embeddings that can be regenerated from source data.

The quest for software engineering knowledge.

Look:
Layout: