n4nAI

RAG latency benchmark: 5 vector database providers

A hands-on vector database RAG latency comparison of Pinecone, Weaviate, Qdrant, Milvus, and pgvector across cost, speed, and ergonomics to guide your pick.

n4n Team4 min read839 words

Audio narration

Coming soon — every post will get a voice note here.

A vector database RAG latency comparison is the first thing you should run before wiring retrieval into a production LLM service, because the lookup sits on the critical path before any generation. We profiled five mainstream engines—Pinecone, Weaviate, Qdrant, Milvus, and pgvector—under identical query patterns to surface where each one adds milliseconds or saves them.

Providers Under Test

  • Pinecone — fully managed SaaS, proprietary distributed index.
  • Weaviate — open-source vector DB with a managed tier, GraphQL and REST APIs.
  • Qdrant — Rust-based open-source engine with a cloud offering, gRPC and REST.
  • Milvus — heavyweight distributed vector DB built on etcd/object storage, with Zilliz Cloud.
  • pgvector — Postgres extension that adds vector type and ANN operators.

All five support approximate nearest neighbor search, but the indexing internals and operational models differ enough to change your p99.

Capabilities

Pinecone keeps it simple: flat or pod-based HNSW, metadata filtering via its own syntax, no hybrid BM25 out of the box. Weaviate ships HNSW and an inverted index for hybrid search, plus a module system for embeddings. Qdrant exposes HNSW with quantized payloads and rigorous filter conditions. Milvus gives you IVF_FLAT, IVF_PQ, HNSW, and disk-based indexes for billion-scale data. pgvector started with IVFFlat and now supports HNSW (v0.5+), but filtering is just SQL WHERE.

If you need strict hybrid ranking or tenant isolation via metadata, Weaviate and Qdrant are the most expressive. Milvus wins on raw scale; pgvector wins on transactional consistency with your existing rows.

Price/Cost Model

Pinecone bills per pod-hour and storage; you pay even when idle. Weaviate Cloud is usage-based with a free tier, and self-hosting is pure infra cost. Qdrant Cloud meters on nodes and storage, with a generous open-source license that lets you run bare metal. Milvus is free OSS but demands etcd, MinIO, and multiple nodes—operational spend is real. pgvector costs nothing beyond your Postgres instance, but you trade off dedicated vector optimization.

For a 10M-vector dataset, the managed options diverge by 3–5x in monthly run rate depending on replica needs; pgvector is cheapest if you already run Postgres at scale.

Latency and Throughput

We did not publish microsecond claims because hardware and index params dominate. What is defensible: in-memory HNSW (Qdrant, Weaviate, Pinecone) returns top-k in single-digit to low-double-digit milliseconds at 1M vectors under concurrent load. Milvus adds a network hop to query nodes, so its p99 is higher unless you over-provision. pgvector with HNSW approaches the in-memory crowd; with IVFFlat it degrades unless lists is tuned to your recall target.

Throughput follows memory bandwidth. Qdrant’s Rust core sustains higher QPS per vCPU than Python-bound paths. Pinecone abstracts this but caps concurrency per pod. If you’re serving retrieval-augmented generation through a gateway like n4n.ai, the vector lookup sits on the critical path before the LLM call, so its latency directly inflates time-to-first-token.

Ergonomics

Client code reveals the DX gap. Pinecone:

import pinecone
pinecone.init(api_key="key")
idx = pinecone.Index("docs")
res = idx.query(vector=vec, top_k=5, filter={"ns": "prod"})

Qdrant:

from qdrant_client import QdrantClient
c = QdrantClient("localhost")
c.search("docs", query_vector=vec, limit=5,
         query_filter={"must": [{"key": "ns", "match": {"value": "prod"}}]})

pgvector is just SQL:

SELECT id, content FROM docs
ORDER BY embedding <-> $1 LIMIT 5;

Weaviate pushes GraphQL; Milvus uses a collection object. Qdrant and Pinecone are the least surprising. pgvector is unbeatable if your team lives in SQL.

Ecosystem and Limits

Pinecone locks you to its control plane—no on-prem. Weaviate has a broad model hub but heavier RAM footprint. Qdrant’s ecosystem is lean; you bring your own embedding pipeline. Milvus integrates with Spark and Kafka but needs a dedicated platform team. pgvector inherits Postgres limits: max connection counts, vacuum overhead, and no distributed sharding without Citus.

Head-to-Head Table

Provider Capabilities Price/Cost Model Latency/Throughput Ergonomics Ecosystem Limits
Pinecone HNSW, metadata filter Per-pod-hour + storage Low ms p99, capped concurrency Minimal Python/REST SaaS-only No self-host, vendor lock
Weaviate HNSW + inverted hybrid Usage or self-host Low ms, RAM-heavy GraphQL/REST Model modules High memory per vector
Qdrant HNSW, quantized, filter Node+storage or OSS Best QPS/vCPU, low ms gRPC/REST, clean Lean Smaller community
Milvus IVF/HNSW/disk, billion-scale OSS + managed Higher p99 at scale Collection API Spark/Kafka ties Ops complexity
pgvector IVFFlat/HNSW in PG Postgres cost only Near in-memory w/ HNSW Plain SQL Postgres extensions No native sharding

Which to Choose

Prototype or solo builder: pgvector. If you already have Postgres, the zero-new-infra path gets you to RAG in an afternoon. Tune HNSW m and ef_search and you stay under 20ms for most queries.

Managed simplicity, low ops: Pinecone. You sacrifice cost visibility and portability, but you get a stable endpoint and zero index tuning. Acceptable when retrieval latency is not your differentiator.

High-throughput, cost-conscious self-host: Qdrant. Its Rust core and quantization let a single node serve serious QPS. Use it when you need to control every millisecond and dollar.

Hybrid search and rich filtering: Weaviate. The inverted index plus vector fusion is native, so you skip building a separate keyword path. Budget RAM accordingly.

Billion-scale or existing data lake: Milvus. Only pick it when you’ve outgrown single-node indexes and can staff the etcd/MinIO operational load. For most sub-100M-vector RAG apps it is overkill.

The right vector database RAG latency comparison outcome is use-case driven: match the engine to your scale class and team shape, not to a benchmark leaderboard.

Tagsragvector-databaselatencybenchmark

Written by

n4n Team

The team building n4n — a single OpenAI-compatible API in front of 240+ models, with automatic fallback, load balancing and pay-per-token metering.

More from n4n Team →

All rag pipeline latency benchmarks posts →