-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Using the query
[
{$sort: {a: 1}},
{$group: {_id: "$a"}}
]
and indexes
{a: 1} {a: 1, b: 1}
With default flags, we only consider one plan, and the "isCached" value is correct in explain.
With the featureFlagShardFilteringDistinctScan flag enabled, we multiplan two plans (a distinct scan for each index), and one plan gets cached. When explain is run, they're both listed as "isCached: true"
isCached should only be true for one plan, since a query can only have one chosen solution in the cache.