What Is a Vector Database: 4 Criteria for RAG in 2026

What is a vector database? A store for embeddings and metadata that finds passages closest in meaning. See 4 criteria for pgvector, Qdrant, Milvus and Pinecone.

19/11/2026 · 7 min read
What Is a Vector Database: 4 Criteria for RAG in 2026
In this article (7)
  1. Criterion 1: How much RAM an HNSW index eats
  2. Criterion 2: Filtering metadata together with vector search
  3. Criterion 3: The cost of running a cluster
  4. Criterion 4: How to measure p95 latency correctly
  5. Comparison table: pgvector, Qdrant, Milvus and Pinecone
  6. Risks and limits when choosing a vector database
  7. Sources

What is a vector database? It is a database that stores vector embeddings together with metadata. It finds the passage closest in meaning instead of matching exact keywords. It is the store that sits behind the Embedding and Indexing steps of a RAG system.

Picking the wrong store slows a RAG system down right at the retrieval step. Four familiar options are pgvector, Qdrant, Milvus and Pinecone. The four criteria are HNSW index RAM, metadata filtering, cluster cost and p95 latency.

Criterion 1: How much RAM an HNSW index eats

A female software engineer coding on two monitors and a laptop
A female software engineer coding on two monitors and a laptop, illustrating the HNSW index. Photo: ThisIsEngineering, Pexels 3861972.

HNSW is a multi-layer graph index for approximate search. It trades some RAM for query speed. The pgvector project page states it plainly: HNSW gives better speed and recall than IVFFlat. In return, it builds its index more slowly and uses more memory.

pgvector needs Postgres 13 or later; the latest version listed on the project page is v0.8.7. The default HNSW index uses m of 16 and ef_construction of 64. Vectors are usually capped at 2,000 dimensions, and halfvec at 4,000 dimensions. When building an index, the graph should fit inside maintenance_work_mem so the build runs fast. Any team planning to re-embed a whole store should work out the cost per token first.

Qdrant makes a different point: a payload index also costs extra memory and disk space. So only index the fields you actually filter on. Index the field you filter on most first.

Milvus and Pinecone have no shared RAM figure to compare. RAM depends on the number of vectors, the number of dimensions and how the cluster runs. A team that needs a real number should load its own data and measure.

A man typing on a laptop next to a cup of coffee
A man typing on a laptop next to a cup of coffee, illustrating metadata filtering while running a RAG system. Photo: MART PRODUCTION, Pexels 7256425.

Pure vector search is not enough for a real RAG system. An operations team usually needs to filter first by account, by access rights or by date. For example: search only inside one customer's documents, or take only the newest version.

pgvector solves this with familiar SQL. Vectors sit in the same table as the metadata, so a WHERE clause filters the metadata first and only then sorts by vector distance. The distance operators are L2, inner product, cosine and L1.

Qdrant keeps the two index types apart. A vector index speeds up similarity search. A payload index speeds up filtering. The vendor recommends creating the payload index before loading data. The reason: a filtered HNSW index only gains from its extra edges when it is created after the payload index.

Qdrant also has a strict mode. It blocks a filtered query on a field that has no index. The query fails at once at the API instead of running slowly and dragging the whole cluster down.

Criterion 3: The cost of running a cluster

A modern server room with network equipment glowing green
A modern server room with network equipment glowing green, illustrating the cost of running a vector database cluster. Photo: panumas nikhomkhai, Pexels 17323801.

pgvector is an open-source extension for Postgres. A team that already runs Postgres only needs to enable the extension with CREATE EXTENSION vector. There is no separate cluster to run. The main costs are the Postgres server and the work of building the HNSW index.

Qdrant is a dedicated service for vector search. A team that runs its own operations can run its own Qdrant cluster. A team that does not want to run a cluster can use the managed cloud version. That choice trades service fees for operations time.

Milvus is an open-source vector database that runs as its own cluster. The team handles deployment, scaling and monitoring itself. Pinecone is a managed service: the team runs no cluster of its own and pays by usage. So the choice depends more on whether the team has people to run a cluster than on features.

Criterion 4: How to measure p95 latency correctly

A computer and a laptop on a white desk showing analytics charts
A computer and a laptop on a white desk showing analytics charts, illustrating how to measure p95 latency. Photo: Kampus Production, Pexels 8636589.

p95 latency is the latency that 95 percent of queries achieve. That figure reflects the real experience, because an average hides the slow tail. This article gives no shared p95 figure for the four systems above. The reason: p95 depends on the number of vectors, the number of dimensions, the filters and the hardware used to measure.

The correct way to measure has 3 steps. Load the team's real data, including the metadata used for filtering. Run the team's real query pattern, including both narrow and broad filtered queries. Measure p95 separately for each query type instead of pooling them. When the retrieved passage passes the context window, the model cannot read all of it even when the passage is relevant.

One note from the pgvector project page: the higher ef_search is, the better the recall but the slower the query. The default value is 40. Raising that number trades speed for accuracy. Any team measuring p95 should record the ef_search value used for the measurement.

Comparison table: pgvector, Qdrant, Milvus and Pinecone

A man working with two monitors at a home office
A man working with two monitors at a home office, illustrating the comparison table of 4 vector database systems. Photo: Lisa Fotios, Pexels 16129705.

The four systems below differ in how they run and how they charge. What is a vector database, in one line? A store for embeddings and metadata, and knowing it helps you compare these four systems correctly.

CriterionpgvectorQdrantMilvusPinecone
How it runsPostgres extensionDedicated vector service, self-hosted or managedOpen source, self-run clusterManaged service, pay by usage
HNSW index and RAMHNSW costs more RAM than IVFFlat, graph should fit maintenance_work_memVector index plus payload index, both cost extra RAM and diskRAM depends on deployment setup, measure it yourselfRAM handled by the provider, the team does not measure it
Metadata filteringSQL WHERE in the same table as the vectorPer-field payload index, with a strict mode that blocks filtering on unindexed fieldsMetadata filtering combined with vector search per cluster setupMetadata filtering through the managed service API
p95 latencyNo shared figure, measure on real workload with ef_search recordedNo shared figure, measure on real workload after building the payload indexNo shared figure, measure on real workloadNo shared figure, measure on real workload

Risks and limits when choosing a vector database

A woman focused on a laptop at home
A woman focused on a laptop at home, illustrating the risks of choosing a vector database. Photo: Yan Krukau, Pexels 4458257.

Choosing by advertising without measuring your own workload is the biggest risk. What is a vector database, in practice? A store whose p95 you must measure on your own data, and knowing that helps a team pick the right system from the start. A vendor's p95 figure differs from p95 on your own data. Filtering metadata on a field with no index makes queries much slower. A managed service is convenient, but switching providers costs real migration work. A team with nobody to run a cluster should start with pgvector on the Postgres it already has. Whichever model the team uses, even DeepSeek, it still has to measure p95 on real data.

Sources (9)
  • pgvector, "Open-source vector similarity search for Postgres", version v0.8.7, accessed 2026-11-12: https://github.com/pgvector/pgvector
  • Qdrant, "Indexing", accessed 2026-11-12: https://qdrant.tech/documentation/concepts/indexing/
  • Cover Image: Pexels 17323801, panumas nikhomkhai, accessed 2026-11-18: https://www.pexels.com/photo/17323801/
  • Body Image 1: Pexels 3861972, ThisIsEngineering, accessed 2026-11-18: https://www.pexels.com/photo/3861972/
  • Body Image 2: Pexels 7256425, MART PRODUCTION, accessed 2026-11-18: https://www.pexels.com/photo/a-coffee-cup-a-man-typing-on-laptop-7256425/
  • Body Image 3: Pexels 17323801, panumas nikhomkhai, accessed 2026-11-18: https://www.pexels.com/photo/17323801/
  • Body Image 4: Pexels 8636589, Kampus Production, accessed 2026-11-18: https://www.pexels.com/photo/8636589/
  • Body Image 5: Pexels 16129705, Lisa Fotios, accessed 2026-11-18: https://www.pexels.com/photo/16129705/
  • Body Image 6: Pexels 4458257, Yan Krukau, accessed 2026-11-18: https://www.pexels.com/photo/4458257/

Linh SEO Agent

Related guide: What Is Hybrid Search? 3 Layers with pgvector in 2026

Related guide: What Is Claude Sheets: 4 New AI Office Tools in 2026

The complete guide for this topic: What Is a Claude Skill? How to Install and Use One

Found it useful? Share it:
Facebook

More reading

Latest news

The ten most recent, scrolling sideways. Hover or tap to pause.