---
title: "pgvector 0.4.0 performance"
description: "With tuned settings, pgvector 0.4.0's IVFFlat index handles 1M OpenAI embeddings (1536 dimensions, dbpedia dataset) at about 1800 QPS with 0.91 accuracy@10 on a 64-core, 256 GB instance, or about 670 QPS at 0.98 accuracy."
url: "https://swe.quest/articles/pgvector-0-4-0-performance-559fc540f926a562"
canonical: "https://supabase.com/blog/pgvector-performance"
source: "Supabase"
published: "2023-07-13"
difficulty: "medium"
kind: "Research"
reading_minutes: 8
tags: ["vector-search","postgres","performance","inference"]
---

# pgvector 0.4.0 performance

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2023-07-13, 8 min read, Research. Original: [https://supabase.com/blog/pgvector-performance](https://supabase.com/blog/pgvector-performance)

## Summary

With tuned settings, pgvector 0.4.0's IVFFlat index handles 1M OpenAI embeddings (1536 dimensions, dbpedia dataset) at about 1800 QPS with 0.91 accuracy@10 on a 64-core, 256 GB instance, or about 670 QPS at 0.98 accuracy. Using the ANN Benchmarks methodology, the tests reproduce a default-config pgvector vs Qdrant comparison. Pre-warming RAM, using inner-product distance, raising lists to 2000 and increasing probes makes pgvector competitive, and throughput scales predictably with instance size. Practical guidance: raise lists above the recommended rows/1000 for faster queries at the cost of longer index builds and more maintenance\_work\_mem, prefer inner product for normalized embeddings, and benchmark with real rather than random vectors before right-sizing RAM.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)

## Prerequisites

- vector embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- approximate nearest neighbor search ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- PostgreSQL configuration basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

pgvector, IVFFlat, Qdrant, ANN Benchmarks, Supabase, HNSW, Vecs, OpenAI embeddings

## Related posts

- [pgvector v0.5.0: Faster semantic search with HNSW indexes](https://swe.quest/articles/pgvector-v0-5-0-faster-semantic-search-with-hnsw-indexes-d1e5c38ac44f551e.md): Supabase · 2023-09-06 · Medium · 6 min read · Vector search, PostgreSQL, Performance engineering, Algorithms
  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.
- [pgvector vs Pinecone: cost and performance](https://swe.quest/articles/pgvector-vs-pinecone-cost-and-performance-1633fd397036020d.md): Supabase · 2023-10-10 · Medium · 5 min read · Vector search, PostgreSQL, Performance engineering, Cost optimization
  On a ~$410/month Supabase 2XL instance (8-core ARM, 32 GB RAM) with an HNSW index (m=36, ef\_construction=128), pgvector delivered far higher throughput than budget-matched (~$480/month) Pinecone setups on 1M OpenAI 1536-d dbpedia embeddings.
- [20x faster than pgvector: introducing pg\_embedding extension for vector search in Postgres and LangChain](https://swe.quest/articles/20x-faster-than-pgvector-introducing-pg-embedding-extension-for-vector-search-058737fc9388f495.md): Neon · 2023-07-11 · Medium · 7 min read · Vector search, PostgreSQL, Performance engineering
  pg\_embedding brought HNSW graph-based approximate nearest neighbor indexing to Postgres.
- [Optimizing vector search performance with pgvector](https://swe.quest/articles/optimizing-vector-search-performance-with-pgvector-4b331670a6e9890b.md): Neon · 2023-06-28 · Medium · 4 min read · Vector search, PostgreSQL, Performance engineering
  pgvector's default sequential scan gives exact, 100%-recall similarity search but slows noticeably past about 50k rows.
- [How to Use pgvector for Similarity Search on Heroku Postgres](https://swe.quest/articles/how-to-use-pgvector-for-similarity-search-on-heroku-postgres-c4879269328732cd.md): Heroku Engineering · 2023-11-16 · Medium · 5 min read · Vector search, PostgreSQL, Python
  Heroku Postgres now supports the pgvector extension on Standard-tier and higher databases running Postgres 15, enabled with \`CREATE EXTENSION vector;\`.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
