[SERVER-30994] Allow queries containing $not to use non-btree indices Created: 07/Sep/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-44011 Optimise queries with logical operato... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

There is no obvious reason to disallow non-btree index usage with a $not expression. Several geo tests show that the planner is generating correct index bounds for queries containing $not and a geo index:

https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/query_planner_geo_test.cpp#L965

https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/query_planner_geo_test.cpp#L1085



 Comments   
Comment by Asya Kamsky [ 08/Sep/17 ]

Does the sparseness of the index affect correctness in some of these cases?

Generated at Thu Feb 08 04:25:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.