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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Execution
    • ALL

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: