-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: 2.6.5
-
Component/s: Index Maintenance
-
None
-
ALL
-
In the following reproduction we have:
- A rooted $or query that matches no documents
- 2 indexes that are equally efficient at determining there are no matches
When the query is run, the 2 indexes tie and the first index created is chosen as winner and cached.
In a subsequent query which has 1 match, the cached plan in used with no evaluation. This results in the scanning of 20 index entries where the alternate index can perform the same scanning only 2.
The query planner should allow for correct index choice in this scenario.