{"slug": "stop-guessing-your-vector-db-size-the-production-sizing-field-guide-for-4", "title": "Stop Guessing Your Vector DB Size: The Production Sizing Field Guide for 4 Million Passages", "summary": "Engineers at Databricks benchmarked vector and hybrid search across 1, 2, and 4 million MIRACL Wikipedia passages using 1024-dimensional gte-large-en-v1.5 embeddings, finding that ANN index structures add roughly 40% overhead over raw float arrays, or about 5.75 GB per million passages. The measurements show latency turning bimodal when the local file cache ratio falls too low, and that lowering the candidate retrieval limit from the tutorial default of 1,000 to 200 roughly halves cold query latency.", "body_md": "# Stop Guessing Your Vector DB Size: The Production Sizing Field Guide for 4 Million Passages\n\nWhat Databricks measured across 4 million Wikipedia passages: how to calculate index memory per million vectors, why cache ratios dictate latency, and why 200 candidates beat 1,000.\n\nWhen engineering teams build their first Retrieval-Augmented Generation (RAG) prototype, sizing the vector database is rarely a priority.\n\nYou embed 50,000 documentation chunks, spin up a small Postgres instance with `pgvector` or a starter Qdrant node, and run similarity queries. Results come back in 8 milliseconds.\n\nThen you roll the system out to production data.\n\nYou ingest 4 million passages across internal wikis, support tickets, and product catalogs. Within hours, search latency turns erratic: half your queries return in 10 milliseconds, while the other half stall for 200 milliseconds. You double the database instance size, yet throughput barely budges while your cloud bill quadruples.\n\nThe problem is rarely the vector database engine itself. Most teams run into trouble because they size vector search by trial and error. They do not calculate index memory expansion on disk, they ignore the ratio between local file cache RAM and index size, and they leave candidate retrieval limits at the tutorial default of 1,000.\n\nRecently, engineers at **Databricks** published a detailed empirical benchmark measuring vector and hybrid search across **1 million, 2 million, and 4 million passages** from the MIRACL English Wikipedia corpus using 1024-dimensional embeddings (`gte-large-en-v1.5`).\n\nTheir data gives us concrete numbers for how vector indexes grow, why latency turns bimodal under memory pressure, and how a single parameter tweak cuts cold query latency in half.\n\n## How Fast Does a Vector Index Actually Grow?\n\nTo size a vector store properly, you first have to separate the raw table data (your text chunks and metadata columns) from the approximate nearest neighbor (ANN) vector index structure.\n\nIn Databricks’ tests, every passage was embedded into a 1024-dimensional float vector (the same dimensionality used by many commercial and open-source large embedding models). Storing one million raw 1024-dimensional `float32` vectors takes roughly 4.1 GB (`1,000,000 * 1024 * 4 bytes`).\n\nOnce you build a navigable graph or quantized proximity index over those vectors, the index structure adds roughly 40% overhead on top of the raw float arrays:\n\nNotice how cleanly linear that growth is. For 1024-dimensional embeddings, you can rely on a straightforward rule of thumb: **budget roughly 5.75 GB of index footprint per million passages**, completely separate from your relational text tables and B-tree indexes. If you are planning a 10-million-passage corpus, your vector index alone will occupy around 57.5 GB.\n\n## The Cache Ratio Rule: Why Latency Jumps From 4ms to 187ms\n\nA common misconception in vector search is that you must buy an enormous in-memory server that pins 100% of your database in active process memory at all times. Modern disk-backed and page-cached engines do not require pure in-memory storage, but their performance is governed by a single ratio: the **Local File Cache Ratio**.\n\nWhen a database traverses an ANN graph to answer a similarity query, it reads 8 KB pages. Because a 1024-dimensional `float32` vector takes 4 KB on its own, a single 8 KB database page holds only one or two vectors plus graph neighbor pointers. A single query inspecting a few hundred candidate nodes touches hundreds of distinct 8 KB pages scattered across the index.\n\nIf those pages are sitting in local RAM cache, fetching them takes microseconds. If they miss the cache, the engine has to stall on hundreds of random disk or remote storage reads.\n\nDatabricks measured query latency across different cache ratios on the 4-million-passage index, and the cliff is dramatic:\n\n- **At a Cache Ratio of 0.07 (severe RAM starvation):** 93% of page lookups miss the local cache and hit cold storage. Median warm vector search latency sits at**187 milliseconds** .\n- **At a Cache Ratio of 0.3 to 0.7 (partial caching):** Latency turns**bimodal** . Queries hitting frequently accessed clusters return in 6 milliseconds, while queries traversing uncached regions of the graph spike to 180 milliseconds. In an agent loop that runs five sequential retrieval calls per turn, a 50% cache-miss rate guarantees at least one or two slow stalls on every single user prompt.\n- **At a Cache Ratio of 1.0 or higher (cache matches index size):** 96% to 98% of page reads hit local memory, and median warm latency drops to**4 milliseconds** .\n\nEven more revealing: once your Cache Ratio reaches **1.0**, **search latency stays flat as your dataset grows**. Searching 4 million passages with a 1.0 cache ratio took the same 11 to 23 milliseconds as searching 1 million passages. Corpus size only slows down queries when your cache ratio falls below 1.0 and forces disk I/O.\n\n## Why 200 Candidates Beat 1,000\n\nAlmost every vector search SDK and tutorial includes a parameter governing how many candidate vectors the ANN search inspects before returning your final top-10 results (often named `ef_search`, `probes`, or `candidate_limit`). And almost every boilerplate code snippet sets that number to **1,000**.\n\nDatabricks benchmarked what actually happens when you drop the candidate pool from **1,000 down to 200** when retrieving the top 10 passages:\n\n- **Two-thirds fewer page reads:** Inspecting 200 candidates instead of 1,000 reads only one-third as many 8 KB pages from the index.\n- **50% faster cold queries:** When queries do miss the cache and hit storage, cutting the candidate pool to 200 slashes cold search latency in half.\n- **90.5% overlap in top-10 results:** Despite doing one-third of the work, a 200-candidate search returned**90.5% of the exact same top-10 passages** as a 1,000-candidate search.\n\nIf you pair that with a higher-quality index build configuration during ingestion (for instance, using high-precision quantization or higher build-time graph connectivity rather than compensating at query time with massive probe counts), you get better recall at a fraction of the per-query I/O cost. In Databricks’ tests, building the index in quality mode raised baseline Recall@10 from 0.74 to 0.80 at 3 milliseconds, and reached 0.91 recall at 500 probes in less than half the query time of a standard index.\n\n## When Scaling the Database Stops Helping: The Python Worker Bottleneck\n\nOne of the most useful findings in the Databricks benchmark had nothing to do with vector math. It happened during concurrency load testing.\n\nThe team scaled the database tier from 1 Compute Unit (CU) up to 16 CUs under continuous query load. From 1 CU to 8 CUs, throughput scaled cleanly. Going from **8 CUs to 16 CUs**, however, doubling the database hardware produced only a **4% gain in query throughput**.\n\nWhen throughput plateaus like that in production, the knee-jerk reaction is to blame the vector index. In reality, the database CPU at 16 CUs was sitting mostly idle. The bottleneck had moved into the **Python application tier**: the worker processes issuing queries and parsing JSON responses were saturated on connection pooling and serialization. Before upgrading a vector database node, always verify that database CPU utilization is actually crossing 60%.\n\n## A Practical Vector Sizing Calculator in Python\n\nBefore provisioning hardware for a new RAG or semantic search workload, you can estimate your index footprint, required page-cache RAM, and concurrency budget with a quick back-of-the-envelope script:\n\n``` python\nfrom typing import Dict, Union\n\ndef estimate_vector_search_footprint(\n    num_passages: int,\n    embedding_dim: int = 1024,\n    bytes_per_float: int = 4,\n    ann_overhead_multiplier: float = 1.40,\n) -> Dict[str, Union[int, float, str]]:\n    # 1. Raw float array size in GB\n    raw_bytes = num_passages * embedding_dim * bytes_per_float\n    raw_gb = raw_bytes / (1024 ** 3)\n\n    # 2. ANN graph / index footprint on disk (~5.75 GB per 1M at 1024d)\n    index_gb = raw_gb * ann_overhead_multiplier\n\n    # 3. Target local file cache RAM for Cache Ratio >= 1.0 (+15% OS buffer headroom)\n    target_cache_ram_gb = index_gb * 1.15\n\n    return {\n        \"passages\": f\"{num_passages:,}\",\n        \"raw_vectors_gb\": round(raw_gb, 2),\n        \"ann_index_gb\": round(index_gb, 2),\n        \"recommended_cache_ram_gb\": round(target_cache_ram_gb, 2),\n        \"recommended_candidate_pool\": 200,\n    }\n\n# Sizing a 4-million-passage corpus with 1024-d embeddings:\nprint(estimate_vector_search_footprint(4_000_000, embedding_dim=1024))\n# {'passages': '4,000,000', 'raw_vectors_gb': 15.26, 'ann_index_gb': 21.36,\n#  'recommended_cache_ram_gb': 24.57, 'recommended_candidate_pool': 200}\n```\n\n## Sizing by Physics, Not Folklore\n\nVector search does not have to be a mysterious black box that eats cloud budgets. The rules that govern latency at scale are straightforward:\n\n- Budget roughly **5.75 GB of index space per million 1024-dimensional vectors** .\n- Provision enough local file-cache memory to keep your **Cache Ratio at or above 1.0** , which holds warm search latency flat in the single-digit milliseconds whether you have 1 million or 10 million passages.\n- Drop your query **candidate pool from 1,000 to 200** (and invest in index build quality instead of brute-force query probes) to cut cold page reads by two-thirds while preserving over 90% top-10 overlap.\n\nWhen your cache ratio is right and your candidate pool is bounded, a 14-minute load test serving 109,000 vector queries in Databricks’ benchmark cost just **$0.02 in compute**. Good capacity planning is still the best latency optimization money can buy.\n\n### Further Reading & Resources\n\n- **[Databricks Blog: Sizing Lakebase Search: Lessons from a Real App and 4 Million Passages](https://www.databricks.com/blog/sizing-lakebase-search-lessons-real-app-and-4-million-passages)** : The full empirical benchmark covering 1M, 2M, and 4M MIRACL passage workloads.\n- **[MIRACL Benchmark Dataset](https://project-miracl.github.io/)** : The Wikipedia passage retrieval benchmark used in the sizing experiments.\n- **[pgvector Documentation](https://github.com/pgvector/pgvector)** : Open-source vector similarity search for PostgreSQL, including HNSW and IVFFlat index tuning parameters.\n- **[gte-large-en-v1.5 Model Card](https://huggingface.co/Alibaba-NLP/gte-large-en-v1.5)** : The 1024-dimensional embedding model evaluated in the benchmark.", "url": "https://wpnews.pro/news/stop-guessing-your-vector-db-size-the-production-sizing-field-guide-for-4", "canonical_source": "https://mlnotes.substack.com/p/stop-guessing-your-vector-db-size", "published_at": "2026-12-06 15:02:21+00:00", "updated_at": "2026-12-06 15:16:46.673360+00:00", "lang": "en", "topics": ["ai-infrastructure", "mlops", "large-language-models", "ai-tools"], "entities": ["Databricks", "MIRACL", "gte-large-en-v1.5", "pgvector", "Qdrant"], "also_reported_by": [], "takeaway": "Budget about 5.75 GB of ANN index footprint per million 1024-dimensional passages (roughly 40% over the 4.1 GB of raw float32 vectors), keep the local file cache ratio high to avoid bimodal latency, and cut candidate retrieval from 1,000 to 200 to roughly halve cold query latency.", "recommendation": {"advice": "Size vector indexes at ~5.75 GB per million 1024-dim passages, keep the local file cache ratio well above 0.07, and lower candidate retrieval to 200 to cut cold query latency roughly in half.", "playbook": "rag-retrieval", "playbook_url": "https://wpnews.pro/playbooks/rag-retrieval"}, "alternates": {"html": "https://wpnews.pro/news/stop-guessing-your-vector-db-size-the-production-sizing-field-guide-for-4", "markdown": "https://wpnews.pro/news/stop-guessing-your-vector-db-size-the-production-sizing-field-guide-for-4.md", "text": "https://wpnews.pro/news/stop-guessing-your-vector-db-size-the-production-sizing-field-guide-for-4.txt", "jsonld": "https://wpnews.pro/news/stop-guessing-your-vector-db-size-the-production-sizing-field-guide-for-4.jsonld"}}