Skip to main content
BlogAI

pgvector vs Pinecone vs Qdrant: Choosing Your Vector Database in 2025

A practical comparison of the top vector database options — performance benchmarks, pricing, and which one to choose for your specific use case.

Matthews Wong

Software Engineer

June 202511 min read
AI

Every RAG application needs a vector database. The choice between pgvector, Pinecone, Qdrant, and Weaviate isn't just a performance decision — it's an operational complexity, cost, and integration decision. I've used pgvector in my AI Gymbro project and experimented with Pinecone and Qdrant for ERP document search.

DimensionpgvectorPinecone
Hosting modelRuns inside your existing PostgreSQL instanceFully managed, separate vector database service
CostNo extra cost beyond your existing PostgresUsage-based pricing on top of your existing stack
Query latency at scaleCompetitive up to a few million vectors with proper indexingPurpose-built for consistent low latency at massive scale
Operational overheadYou manage indexing, vacuuming, and scalingFully managed, no infrastructure to operate
Data localityVectors live alongside relational data, easy joinsVectors live in a separate system, needs a sync pipeline
Setup complexityOne extension install if you already run PostgresNew account, API keys, and a separate SDK
Best fitTeams already on Postgres wanting to avoid a new systemTeams needing dedicated, massive-scale vector search

The Vector Database Market in 2025

The vector database market consolidated significantly in 2024-2025. pgvector with HNSW indexing achieves ~95% of Pinecone's query performance at 1M vectors with zero additional infrastructure cost. The 2025 landscape: pgvector for existing PostgreSQL users, Qdrant for self-hosted performance-critical workloads, Pinecone for fully managed large-scale deployments.

pgvector: Deep Dive

pgvector adds vector data types and similarity search operators to PostgreSQL. The HNSW index (available since pgvector 0.5.0) dramatically improves query performance. The killer advantage: your vector embeddings live in the same database as your application data. You can JOIN embeddings with user data and run everything in a single transaction.

Pinecone: Deep Dive

Pinecone is a purpose-built vector database as a service. No infrastructure to manage, automatic scaling, sub-10ms query latency at billion-scale. The tradeoff: cost. Pinecone's Starter tier handles ~100K vectors. The Standard tier starts at ~$70/month for serverless.

Vector Database Performance Comparison — 1M vectors, 1536 dim

Database        P95 Latency   QPS        Cost/mo     Self-host?
──────────────────────────────────────────────────────────────
pgvector HNSW   45ms          500        $50 (pg)    Yes
Qdrant          8ms           2,000      $40 (VPS)   Yes
Pinecone        12ms          unlimited  $70+        No
Weaviate Cloud  15ms          ~1,000     $80+        No

pgvector HNSW Setup:
  CREATE EXTENSION vector;
  CREATE INDEX ON docs USING hnsw (embedding vector_cosine_ops)
  WITH (m = 32, ef_construction = 128);

  → At query time: SET hnsw.ef_search = 64;

Recommended by use case:
  ≤ 5M vectors + PostgreSQL already → pgvector
  Need best filtering + self-host    → Qdrant
  Billion-scale + fully managed      → Pinecone

For PostgreSQL users considering pgvector: the HNSW index parameters ef_construction and m dramatically affect the quality/performance tradeoff. I run ef_construction=128 and m=32 for my fitness content embeddings — higher quality index that takes longer to build but gives better recall. At query time, set ef_search=64 or higher for better recall.

Qdrant: The Open-Source Contender

Qdrant is an open-source vector database written in Rust with exceptional performance and filtering capabilities. It supports both dense and sparse vectors in the same collection, enabling native hybrid search without external tooling. Self-hosted on a $20/month DigitalOcean droplet, Qdrant handles 1M vectors comfortably.

Performance Comparison at Scale

At 1M vectors with 1536-dimension OpenAI embeddings: pgvector (HNSW, m=32): P95 45ms, handles ~500 QPS on a $50/month managed PostgreSQL instance. Qdrant (self-hosted): P95 8ms, handles ~2,000 QPS on a $40/month VPS. Pinecone (serverless): P95 12ms, handles unlimited QPS (auto-scales).

-- pgvector: vector search with metadata filter
-- JOIN with application data in same query
SELECT
  d.id,
  d.content,
  d.metadata,
  u.username AS author,           -- JOIN with users table!
  1 - (d.embedding <=> $1::vector) AS similarity
FROM documents d
JOIN users u ON d.user_id = u.id
WHERE
  d.metadata->>'category' = 'exercise'  -- metadata filter
  AND d.created_at > NOW() - INTERVAL '30 days'
ORDER BY d.embedding <=> $1::vector     -- vector similarity
LIMIT 5;

-- Pinecone equivalent (Python)
# No JOIN possible — must fetch user from separate DB call
index = pinecone.Index("my-index")
results = index.query(
    vector=query_embedding,
    filter={"category": "exercise"},  # metadata filter
    top_k=5,
    include_metadata=True,
)
# Then separately: fetch user data from your database
user_ids = [r["metadata"]["user_id"] for r in results["matches"]]
users = await db.fetch_users(user_ids)  # second DB call!

Hybrid Search: When You Need Both Semantic and Keyword

Pure vector search misses exact keyword matches. Hybrid search combines vector similarity with BM25 keyword scoring. Qdrant supports this natively. For pgvector, you combine vector search with PostgreSQL's built-in full-text search and merge the result sets in application code.

pgvector's sequential scan (no index) becomes dangerously slow above 100K vectors — a query that takes 5ms with 10K vectors takes 500ms+ with 1M vectors. Always create an HNSW index before storing more than 50K vectors. Also: run REINDEX on your vector column during low-traffic periods to rebuild the index and restore recall quality.

Migration Strategy: pgvector to Pinecone

If you start on pgvector and need to scale beyond its limits, migrating to Pinecone or Qdrant is straightforward: your embeddings are just floating-point arrays. Export from PostgreSQL, import into Pinecone/Qdrant via their bulk upload APIs, update your search code. Total migration time for 500K vectors: 2-3 days including testing.

My Recommendation by Use Case

Use pgvector if: you're on PostgreSQL, you have under 5M vectors, or you need transactional consistency. Use Qdrant if: you're not on PostgreSQL, you need the best filtering performance, or you want hybrid search built-in. Use Pinecone if: you need billion-scale with zero operational overhead, or you need enterprise SLAs.

Sources & Further Reading

FAQ

Frequently Asked Questions

Short answers to what readers ask most about this topic.

When should I choose pgvector over Pinecone or Qdrant?

Choose pgvector if you are already on PostgreSQL, have fewer than 5 million vectors, or need transactional consistency between your embeddings and application data. Its killer advantage is that vector embeddings live in the same database as your app data, so you can JOIN embeddings with user records in a single transaction.

Does pgvector perform well at scale, and what index settings matter most?

With an HNSW index, pgvector achieves roughly 95% of Pinecone's query performance at 1 million vectors while adding zero infrastructure cost. The parameters ef_construction and m control the quality-performance tradeoff — the author uses ef_construction=128 and m=32 for fitness content embeddings. Always create an HNSW index before storing more than 50K vectors; without it, query latency can balloon from 5ms to 500ms+ at 1 million vectors.

What are the real cost differences between pgvector, Qdrant, and Pinecone?

At 1 million vectors, pgvector runs on a $50/month managed PostgreSQL instance delivering P95 45ms at ~500 QPS. Qdrant self-hosted on a $40/month VPS delivers P95 8ms at ~2,000 QPS. Pinecone's serverless tier delivers P95 12ms with auto-scaling, but its Standard tier starts at ~$70/month and costs rise with scale.

What is hybrid search, and which vector database supports it best?

Hybrid search combines vector similarity scoring with BM25 keyword scoring so you catch both semantic matches and exact keyword matches. Qdrant supports hybrid search natively in a single collection. With pgvector you implement it by merging vector search results with PostgreSQL's built-in full-text search in application code.

How difficult is it to migrate from pgvector to Pinecone if my data grows?

Migration is straightforward because embeddings are just floating-point arrays. You export them from PostgreSQL, import into Pinecone or Qdrant via their bulk upload APIs, and update your search code. The author estimates total migration time for 500K vectors at 2-3 days including testing.