qdrant-scaling-query-volume
它能做什么
这份指南可以帮你优化 Qdrant 在大数据量下的查询性能。它建议了一种更高效的方式来获取大量结果,避免系统过载。
适用场景
- ✓当一次查询返回的结果过多时。
- ✓如果搜索结果的分页性能很慢。
- ✓当需要获取大量条目或向量时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-scaling/scaling-query-volume/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“当我需要大量结果时,如何让 Qdrant 的搜索更快?”
每周 5 个新技能,1 分钟读完。
工作原理
它不再要求每个数据分片都返回完整的 limit 数量,而是为每个分片请求一个经过计算的较小数量。然后,它再智能地把这些部分结果合并起来。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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.
常见问题
用这种方法会漏掉一些结果吗?
有非常小的概率会漏掉个别结果,但损失很小,与其他本身就会带来轻微误差的搜索方法相当。
什么时候会应用这项优化?
当存在多个数据分片(shard),查询请求的结果数量超过 128,并且不是精确搜索时,就会启用这项优化。
它的主要好处是什么?
主要好处是大幅减少了数据分片之间传输的数据量,让高 limit 的查询更快、更高效。
详情
作者的原始描述
Guides Qdrant query volume scaling. Use when someone asks 'query returns too many results', 'scroll performance', 'large limit values', 'paginating search results', 'fetching many vectors', or 'high cardinality results'.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7371
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。