-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
This ticket is to see if we could have slow query logs for the foreign $lookup collection in all scenarios to make slow query logs and $collStats behavior more consistent with each other (if that is something we want).
In some situations, there will be no slow query logs logged for the foreign collection for $lookup queries. However, $collStats latency histograms for the foreign collection are still incremented for these queries which has led to confusing behavior where the Namespace Insights page (based off of $collStats) can show high latency for a collection, even with no slow query logs. There is a ticket to add documentation for this behavior (DOCS-16910).
We do log slow query logs for the foreign collection if we target another shard when running the $lookup pipeline. However, if we don't target another shard, we will not have any associated slow query logs. Attached is a test file demonstrating the slow query log behavior.