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

Make sure explain.find issued on mongos sends a modified query to the shards

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • ALL
    • QE 2024-04-29, QE 2024-05-13, QE 2024-05-27, QE 2024-06-10, QE 2024-06-24, QE 2024-07-08, QE 2024-07-22, QE 2024-08-05

      While mongos sends modified find query to shards (as part of ClusterFind::runQuery()), it does so only when the command has to be executed and not explained.

      This causes confusion for users as well as developers and make you not trust in explain output, as it is not the same plan.

      As well as this makes testing harder, as explained plan is not the same as the plan found in the $planCacheStats

      It's worth mentioning that since queries in run and explain are different, so are their queryHashes, therefore once can not run explain, retrieve the queryHash and look for the queries in $planCacheStats or slow query logs, as they are different.

       

      This issue goes back in time, to at least 3.4.4, so it's a very old bug.

            Assignee:
            adi.agrawal@mongodb.com Adi Agrawal
            Reporter:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: