cd /news/ai-infrastructure/stop-guessing-your-vector-db-size-th… · home › topics › ai-infrastructure › article
[ARTICLE · art-182929] src=mlnotes.substack.com ↗ pub= topic=ai-infrastructure verified=true sentiment=· neutral

Stop Guessing Your Vector DB Size: The Production Sizing Field Guide for 4 Million Passages

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.

recommendation

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.

more in playbook: Retrieval and RAG
by read8 min views3 publishedDec 6, 2026
Stop Guessing Your Vector DB Size: The Production Sizing Field Guide for 4 Million Passages
Image: Mlnotes (auto-discovered)

What 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.

When engineering teams build their first Retrieval-Augmented Generation (RAG) prototype, sizing the vector database is rarely a priority.

You 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.

Then you roll the system out to production data.

You 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.

The 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.

Recently, 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).

Their 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.

How Fast Does a Vector Index Actually Grow? #

To 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.

In 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).

Once 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:

Notice 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.

The Cache Ratio Rule: Why Latency Jumps From 4ms to 187ms #

A 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.

When 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.

If 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.

Databricks measured query latency across different cache ratios on the 4-million-passage index, and the cliff is dramatic:

  • 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 at187 milliseconds .
  • At a Cache Ratio of 0.3 to 0.7 (partial caching): Latency turnsbimodal . 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.
  • 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 to4 milliseconds .

Even 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.

Why 200 Candidates Beat 1,000 #

Almost 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.

Databricks benchmarked what actually happens when you drop the candidate pool from 1,000 down to 200 when retrieving the top 10 passages:

  • Two-thirds fewer page reads: Inspecting 200 candidates instead of 1,000 reads only one-third as many 8 KB pages from the index.
  • 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.
  • 90.5% overlap in top-10 results: Despite doing one-third of the work, a 200-candidate search returned90.5% of the exact same top-10 passages as a 1,000-candidate search.

If 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.

When Scaling the Database Stops Helping: The Python Worker Bottleneck #

One of the most useful findings in the Databricks benchmark had nothing to do with vector math. It happened during concurrency load testing.

The 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.

When 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%.

A Practical Vector Sizing Calculator in Python #

Before 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:

from typing import Dict, Union

def estimate_vector_search_footprint(
    num_passages: int,
    embedding_dim: int = 1024,
    bytes_per_float: int = 4,
    ann_overhead_multiplier: float = 1.40,
) -> Dict[str, Union[int, float, str]]:
    raw_bytes = num_passages * embedding_dim * bytes_per_float
    raw_gb = raw_bytes / (1024 ** 3)

    index_gb = raw_gb * ann_overhead_multiplier

    target_cache_ram_gb = index_gb * 1.15

    return {
        "passages": f"{num_passages:,}",
        "raw_vectors_gb": round(raw_gb, 2),
        "ann_index_gb": round(index_gb, 2),
        "recommended_cache_ram_gb": round(target_cache_ram_gb, 2),
        "recommended_candidate_pool": 200,
    }

print(estimate_vector_search_footprint(4_000_000, embedding_dim=1024))

Sizing by Physics, Not Folklore #

Vector search does not have to be a mysterious black box that eats cloud budgets. The rules that govern latency at scale are straightforward:

  • Budget roughly 5.75 GB of index space per million 1024-dimensional vectors .
  • 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.
  • 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.

When 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.

Further Reading & Resources

── more in #ai-infrastructure 4 stories · sorted by recency
── more on @databricks 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/stop-guessing-your-v…] indexed:0 read:8min 2026-12-06 · —