-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Consider this example:
db.test.createIndex({"a.$**": 1}) // IXSCAN with "$_path" : ["[\"a.b\", \"a.b\"]", "[\"a.b.\", \"a.b/\")"] + FETCH without filter db.test.find({'a.b': {$exists: true}}).explain() db.test.dropIndexes() db.test.createIndex({"a.$**": 1, b: 1}) // IXSCAN with "$_path" : ["[\"a.b\", \"a.b\"]", "[\"a.b.\", \"a.b/\")"] + FETCH with {$exists: true} db.test.find({'a.b': {$exists: true}}).explain()
In the above example, this behavior is unlikely to cause significant issues because the index scan already filters out all keys where `a.b` doesn't exist. However, when the wildcard part doesn't come first in the compound index, this behavior can trigger the limitation described in SERVER-83322 and prevent $exists: true from being evaluated using the CWI.
- related to
-
SERVER-83322 Compound Wildcard Index bounds reverts to [MinKey, MaxKey] when filter contains fields outside CWI
-
- Backlog
-