[SERVER-12532] Negate index bounds for $not instead of defaulting to a collection scan Created: 29/Jan/14  Updated: 27/Oct/15  Resolved: 15/Feb/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.5.5
Fix Version/s: 2.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: David Storch
Resolution: Done Votes: 0
Labels: query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-12531 $not expression inside $elemMatch cau... Closed
Related
related to SERVER-12684 incorrect result and index not used f... Closed
related to DOCS-2977 Doc behavior changes related to index... Closed
Operating System: ALL
Participants:

 Description   

For a query like

 { a: { $elemMatch: { $gt:4, $not: { $gte:6 } } } } 

the index bounds for an index on "a" should be (4, 6). When handling the $not, we should invert the bounds of its predicate to determine its bounds.



 Comments   
Comment by Githook User [ 16/Feb/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-12532 prevent negations from using special indices such as geo or text
Branch: master
https://github.com/mongodb/mongo/commit/0c065ec66101960e27b4c6cff7f224ec74b8bfed

Comment by Githook User [ 15/Feb/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-12532 negated predicates can use an index
Branch: master
https://github.com/mongodb/mongo/commit/b855e3e54b2cbe9e93ab97866b37beef53d12696

Generated at Thu Feb 08 03:28:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.