Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
3.2.10
-
Query Optimization
-
(copied to CRM)
Description
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}) |
Attachments
Issue Links
- related to
-
SERVER-28889 Partial index shouldn't do fetch on conditions that are true by the definition of the index
-
- Closed
-