-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
Fully Compatible
-
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, QE 2024-08-19, QE 2024-09-02, QE 2024-09-16
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.
- duplicates
-
SERVER-29449 Explain of find command does not transform query for shards
- Backlog
- is related to
-
SERVER-82218 Unify explain and execution path in sharded_agg_helpers
- Closed
- related to
-
SERVER-32563 explain output for sharded count command is incorrect
- Backlog
-
SERVER-94763 Complete TODO listed in SERVER-82471
- Closed