# qdrant-scaling-query-volume

> Optimizes Qdrant query performance for large limits across multiple shards by using Poisson-distributed subsampling to reduce inter-shard data transfer.

- Skill: `github/qdrant-scaling-query-volume` (Agent Skill)
- Install (CLI): `npx skillmds add github/qdrant-scaling-query-volume`
- Raw SKILL.md: https://api.skillmd.com/api/skills/github/qdrant-scaling-query-volume/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics, AI & ML, Coding & Dev Tools, RAG & Embeddings, SQL & Databases
- Tags: Poisson Sampling, Qdrant, Query Optimization, Scalability, Sharding, Vector Database
- Author: GitHub (Microsoft) (https://skillmd.com/u/github), verified publisher
- Updated: 2026-07-06
- Page: https://skillmd.com/skills/github/qdrant-scaling-query-volume

---


# Scaling for Query Volume

Problem: When a query has a large limit (e.g. 1000) and there are multiple shards (e.g. 10), naively each shard must return the full 1000 results — totaling 10,000 scored points transferred and merged. This is wasteful since data is randomly distributed across auto-shards.

## Core idea

Instead of asking every shard for the full limit, ask each shard for a smaller limit computed via Poisson distribution statistics, then merge. This is safe because auto-sharding guarantees random, independent data distribution.

## When it activates

- More than 1 shard
- Auto-sharding is in use (all queried shards share the same shard key)
- The request's limit + offset >= SHARD_QUERY_SUBSAMPLING_LIMIT (128)
- The query is not exact

## Key tradeoff

 The strategy trades a small probability of slightly incomplete results for a large reduction in inter-shard data transfer, especially for high-limit queries across many shards. The 1.2x safety factor and the 99.9% Poisson threshold keep the error rate very low — comparable to inaccuracies already introduced by approximate vector indices like HNSW.
