# Weaviate log output for slow queries

**URL:** https://forum.weaviate.io/t/weaviate-log-output-for-slow-queries/20475
**Category:** Support
**Tags:** feedback, feature-request
**Created:** [April 2, 2025, 3:22pm UTC](https://forum.weaviate.io/t/weaviate-log-output-for-slow-queries/20475 "2025-04-02T15:22:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![louisja1](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@louisja1](https://forum.weaviate.io/u/louisja1)
#### Post date: [April 2, 2025, 3:22pm UTC](https://forum.weaviate.io/t/weaviate-log-output-for-slow-queries/20475/1 "2025-04-02T15:22:00Z")

</div>

![Screenshot 2025-04-02 at 10.59.29 AM](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/2X/4/4b933d81d61a07071df10783cd7f2f3a86733d73.png)

I turned on the slow query logging by setting up the environment variables `QUERY_SLOW_LOG_ENABLED` and `QUERY_SLOW_LOG_THRESHOLD`. Is there a document to help understand what each component means in the log?

For example, what does it mean by `knn_search_rescore`? (Actually I think that is the only question I have)

Thanks in advance!

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [April 3, 2025, 12:41pm UTC](https://forum.weaviate.io/t/weaviate-log-output-for-slow-queries/20475/2 "2025-04-03T12:41:04Z")

</div>

Hi @louisja1 !!

When `QUERY_SLOW_LOG_ENABLED` is enabled, knn\_search\_rescore refers to the second phase of a two-phase search process specifically related to quantized vectors:

Phase 1 - A rough search is performed using compressed vectors with a larger candidate pool than needed.

Phase 2 (Rescore) - For this smaller pool of candidates, Weaviate fetches their uncompressed vector representations and performs a final search to find the true nearest neighbors. This rescoring phase helps maintain 95-97% recall accuracy.

The rescore process can be time-intensive especially with a cold page cache, where rescoring can take significantly longer than with a hot cache. The time spent on rescoring can be a substantial portion of the total query time - in some cases up to 68% of the total query duration.

Let me know if that helps!

THanjks!

---

<div class="post-metadata">

### Author: ![louisja1](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@louisja1](https://forum.weaviate.io/u/louisja1)
#### Post date: [April 3, 2025, 2:18pm UTC](https://forum.weaviate.io/t/weaviate-log-output-for-slow-queries/20475/3 "2025-04-03T14:18:14Z")

</div>

It helps a lot! Thank you!
