-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.2.10
-
Component/s: Querying
-
Query Optimization
-
(copied to CRM)
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Given documents of the form
{
_id: ObjectId("..."),
a: "2016-08-07",
...
b: 2222,
c: 3333
...
},
{
_id: ObjectId("..."),
a: "2016-08-07"
c: 4444,
...
},
{
_id: ObjectId("..."),
a: "2016-08-07",
...
b: 4444,
c: 5555
...
},
And a partial index of the form
db.foo.createIndex({a: -1, b: 1}, partialFilterExpression: {b: {$exists: true}})
The query planner can use this index to fully cover a query of the following form:
db.foo.find({a: { $lte: '2016-08-11' }, b: {$exists: true}}, {_id: 0, a: 1})
- related to
-
SERVER-28889 Partial index shouldn't do fetch on conditions that are true by the definition of the index
-
- Closed
-