Your hybrid query is slow. Now what? Total latency does not tell you whether the bottleneck is vec...
TL;DR · AI 摘要
Weaviate 提供通过慢查询日志和查询分析定位混合查询性能瓶颈的完整方法论,包含具体配置参数和优化方向。
核心要点
- 启用慢查询日志需设置 QUERY_SLOWLOG_ENABLED=true 和 QUERY_SLOWLOG_THRESHOLD=2s
- objects_took 高时需检查存储和页面缓存,filters_build_allow_list_took 高时需优化过滤条件
- 查询分析可按分片和节点定位性能瓶颈,实现 detect-reproduce-diagnose-improve 闭环
结构提纲
按章节快速跳转。
总延迟无法直接定位混合查询的性能瓶颈所在环节。
通过 QUERY_SLOWLOG_ENABLED 和阈值参数被动捕获慢查询。
启用单次请求分析后可按分片和节点获取时间分解数据。
objects_took 对应存储优化,knn_search_rescore_took 对应压缩策略调整。
- ›优化闭环
诊断流程包含检测、复现、诊断、改进四个阶段。
思维导图
用一张图看清主题之间的关系。
查看大纲文本(无障碍 / 无 JS 友好)
- 混合查询性能诊断
- 慢查询日志
- 配置参数
- 阈值设置
- 查询分析
- 分片诊断
- 节点分析
- 优化方向
- 存储优化
- 过滤策略调整
金句 / Highlights
值得收藏与分享的关键句。
objects_took 高时需检查存储、页面缓存、负载大小或结果限制
查询分析可定位到分片和节点层级进行针对性优化
启用慢查询日志可捕获阈值以上的所有慢查询请求
Weaviate AI Database on X: "Your hybrid query is slow. Now what? Total latency does not tell you whether the bottleneck is vector search, keyword scoring, filters, or reading objects from disk. A possible workaround is to enable the slow-query log: - `QUERY𝘚𝘓𝘖𝘞LOG_ENABLED=true` - `QUERY𝘚𝘓… / X
Weaviate AI Database
@weaviate_io
Your hybrid query is slow. Now what? Total latency does not tell you whether the bottleneck is vector search, keyword scoring, filters, or reading objects from disk. A possible workaround is to enable the slow-query log: - QUERY𝘚𝘓𝘖𝘞LOG_ENABLED=true - QUERY𝘚𝘓𝘖𝘞LOG_THRESHOLD=2s It passively finds queries that cross your threshold anywhere in the fleet and logs their timing breakdown. This helps you catch the slow queries you did not know existed. Once you find one, use 𝗾𝘂𝗲𝗿𝘆 𝗽𝗿𝗼𝗳𝗶𝗹𝗶𝗻𝗴 to understand why it is slow. Enable profiling for a single request, then inspect the results by shard and node. The timing breakdown shows where to investigate: - High objects_took: check storage, page cache, payload size, or result limit - High filters_𝘣𝘶𝘪𝘭𝘥_allow_𝘭𝘪𝘴𝘵_took: your filter may be too broad - High knn_𝘴𝘦𝘢𝘳𝘤𝘩_rescore_took: inspect storage and compression - High vector_𝘴𝘦𝘢𝘳𝘤𝘩_took: investigate HNSW traversal, ef, dimensionality, or filter strategy The slow-query log tells you 𝘄𝗵𝗶𝗰𝗵 𝗾𝘂𝗲𝗿𝘆 𝗶𝘀 𝘀𝗹𝗼𝘄. Query profiling tells you 𝘄𝗵𝘆. Together, they help developers move from guessing to finding the right optimization faster: 𝗱𝗲𝘁𝗲𝗰𝘁, 𝗿𝗲𝗽𝗿𝗼𝗱𝘂𝗰𝗲, 𝗱𝗶𝗮𝗴𝗻𝗼𝘀𝗲, 𝗶𝗺𝗽𝗿𝗼𝘃𝗲. Learn more:
weaviate.io/blog/query-pro…
$
00:00
/$
2:36 PM · Oct 30, 2026
·
941
Views
4
2
14