-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When a partial index's partialFilterExpression uses $type, the index is not considered eligible for a query with an equality predicate satisfying that type constraint.
For example,
db.c.createIndex({x: 1},
{partialFilterExpression: {x: {$type: "objectId"}}})
db.c.find({x: ObjectId("...")}).explain()
{ ... "winningPlan": { "stage": "COLLSCAN", ... } }
This query should be eligible to use the partial index.
Proposed solution:
Add a case to isSubsetOf to handle the case of $eq implying $type.
- related to
-
SERVER-20345 Support additional queries with $type=number partial indexes
-
- Backlog
-
-
SERVER-29445 Support additional queries with partial indexes when type is string
-
- Backlog
-