---
title: "pgvector vs Pinecone: cost and performance"
description: "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."
url: "https://swe.quest/articles/pgvector-vs-pinecone-cost-and-performance-1633fd397036020d"
canonical: "https://supabase.com/blog/pgvector-vs-pinecone"
source: "Supabase"
published: "2023-10-10"
difficulty: "medium"
kind: "Research"
reading_minutes: 5
tags: ["vector-search","postgres","performance","cost-optimization"]
---

# pgvector vs Pinecone: cost and performance

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2023-10-10, 5 min read, Research. Original: [https://supabase.com/blog/pgvector-vs-pinecone](https://supabase.com/blog/pgvector-vs-pinecone)

## Summary

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. At matched accuracy@10 it handled about 12x the QPS of six s1 pods and over 4x that of three p1.x2 pods. It was also faster than Pinecone's p2 pods even at 0.99 accuracy versus their 0.94. Pinecone accuracy was measured against pgvector exact KNN results because Pinecone exposes no exact search, and Pinecone can still be cheaper for low-QPS workloads on a single unreplicated pod.

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)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

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

## Keywords

pgvector, Pinecone, HNSW, IVFFlat, ANN Benchmarks, Supabase, dbpedia

## Related posts

- [pgvector 0.4.0 performance](https://swe.quest/articles/pgvector-0-4-0-performance-559fc540f926a562.md): Supabase · 2023-07-13 · Medium · 8 min read · Vector search, PostgreSQL, Performance engineering, Inference & serving
  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.
- [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.
- [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.
- [pgvector 0.6.0: 30x faster with parallel index builds](https://swe.quest/articles/pgvector-0-6-0-30x-faster-with-parallel-index-builds-e5dea50876a1e20f.md): Supabase · 2024-01-30 · Medium · 3 min read · Vector search, PostgreSQL, Performance engineering
  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.
- [Storing OpenAI embeddings in Postgres with pgvector](https://swe.quest/articles/storing-openai-embeddings-in-postgres-with-pgvector-19a5d03614f86fc6.md): Supabase · 2023-02-06 · Medium · 11 min read · Vector search, PostgreSQL, RAG & retrieval, LLMs
  pgvector adds a vector data type and distance operators (Euclidean \<-\>, negative inner product \<#\>, cosine \<=\>) to Postgres, so OpenAI text-embedding-ada-002 embeddings (1536 dimensions) can be stored and queried for similarity directly in the database.

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)
