-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Index Maintenance, Querying
-
None
-
Query Optimization
-
(copied to CRM)
If an index on a string field is defined using partialFilterExpression "$exists" or "$gt":'' then the partial index is used, however, if it's defined using "$type":"string" then the partial index is not used.
// for query db.c.find({a:'Asya'}) // this index is used db.c.createIndex({a:1},{partialFilterExpression:{a:{$exists:true}}}) // this index is used db.c.createIndex({a:1},{partialFilterExpression:{a:{$gt:''}}}) // this index is *not* used db.c.createIndex({a:1},{partialFilterExpression:{a:{$type:"string"}}})
Similar improvement to SERVER-20345 but for "string" types.
- related to
-
SERVER-20345 Support additional queries with $type=number partial indexes
- Backlog