Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-98528

Add slow query logs to $lookup queries for the foreign collection in all scenarios

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.  

            Assignee:
            Unassigned Unassigned
            Reporter:
            erin.zhu@mongodb.com Erin Zhu
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: