跳到正文
Weaviate AI Database· @weaviate_io · X·· 3 小时前AI 评分34
AI 导读

Weaviate 介绍用慢查询日志加查询性能剖析定位混合查询变慢的环节:开启 `QUERY_SLOWLOG_ENABLED=true` 并设 `QUERY_SLOWLOG_THRESHOLD=2s`,可被动捕获全集群中超阈值的查询并记录耗时拆解。

正文 · 原文

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:
https://weaviate.io/blog/query-profiling?utm_source=channels&utm_medium=w_social&utm_campaign=blog_post&utm_content=video_post_268014391

来源:Weaviate AI Database · x.com