-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We should do one of A) disallow these hints, B) ignore the hints, C) (somehow) make them produce the correct query results. I strongly prefer option A or B with a slight preference for A over B.
> db.foo.insert({a:1})
WriteResult({ "nInserted" : 1 })
> db.foo.createIndex({x: '2d'})
{
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"createdCollectionAutomatically" : false,
"ok" : 1
}
> db.foo.createIndex({x: '2dsphere'})
{
"numIndexesBefore" : 2,
"numIndexesAfter" : 3,
"createdCollectionAutomatically" : false,
"ok" : 1
}
> db.foo.createIndex({x: 'text'})
{
"numIndexesBefore" : 3,
"numIndexesAfter" : 4,
"createdCollectionAutomatically" : false,
"ok" : 1
}
// finds a doc
> db.foo.find({a:1})
{ "_id" : ObjectId("61d1143d15ce86cd9a31d385"), "a" : 1 }
// None of these find the doc
> db.foo.find({a:1}).hint({x: '2d'})
> db.foo.find({a:1}).hint({x: '2dsphere'})
> db.foo.find({a:1}).hint('x_text')
>
I didn't test with "somewhat special" indexes like partial indexes or filtered indexes, but they may have the same issue.
- is related to
-
SERVER-18449 Hinting sparse index without sparse-compatible predicate should be disallowed
-
- Backlog
-
-
SERVER-26413 Hinting an incompatible partial index can return incomplete results
-
- In Progress
-
- related to
-
SERVER-26581 hinting index with different collation than query specifies should give an error or warning
-
- Closed
-