All Questions
Vector Search hard

A corpus is hash-sharded across 32 shards. Each shard's in-memory HNSW search has a p50 of 3 ms and a p99 of 25 ms. The coordinator sends every query to all shards, asks each for its top 10, and merges the results. Global p50 is around 20 ms, and global p99 is far above 25 ms. What explains this, and what is a sound mitigation?

  1. A Each shard must return its top 320 (k × shards) to guarantee a correct global top 10, and moving those results dominates.
  2. B The query waits for the slowest shard, so tails become common. Hedge requests or use fewer, larger shards.
  3. C Hash sharding splits HNSW neighborhoods across shards, so the coordinator needs extra cross-shard traversal rounds per query.
  4. D Hash placement leaves some shards much larger than others, and those oversized shards dominate; rebalance vector counts.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions