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.

In this article (7)
- Criterion 1: How much RAM an HNSW index eats
- Criterion 2: Filtering metadata together with vector search
- Criterion 3: The cost of running a cluster
- Criterion 4: How to measure p95 latency correctly
- Comparison table: pgvector, Qdrant, Milvus and Pinecone
- Risks and limits when choosing a vector database
- 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

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.
Criterion 2: Filtering metadata together with vector search

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

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

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

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.
| Criterion | pgvector | Qdrant | Milvus | Pinecone |
|---|---|---|---|---|
| How it runs | Postgres extension | Dedicated vector service, self-hosted or managed | Open source, self-run cluster | Managed service, pay by usage |
| HNSW index and RAM | HNSW costs more RAM than IVFFlat, graph should fit maintenance_work_mem | Vector index plus payload index, both cost extra RAM and disk | RAM depends on deployment setup, measure it yourself | RAM handled by the provider, the team does not measure it |
| Metadata filtering | SQL WHERE in the same table as the vector | Per-field payload index, with a strict mode that blocks filtering on unindexed fields | Metadata filtering combined with vector search per cluster setup | Metadata filtering through the managed service API |
| p95 latency | No shared figure, measure on real workload with ef_search recorded | No shared figure, measure on real workload after building the payload index | No shared figure, measure on real workload | No shared figure, measure on real workload |
Risks and limits when choosing a vector database

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
More reading
What is fine-tuning in AI: 3 ways it differs from using RAG
Claude Skill for Research: Find and Summarize Sources
Poppy protocol 2026: 5 agent shopping steps for Shopify
What is Claude Design in 2026: 5 uses you build by chatting
Perplexity Teammates Max review: always-on agent 2026
How to Write a Claude Skill: SKILL.md Structure








