[SERVER-21065] Optimizer should consider predicate with "$in" operator having a single argument to be equivalent to the equality operator Created: 22/Oct/15  Updated: 17/Jan/17  Resolved: 11/Apr/16

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

Type: Bug Priority: Major - P3
Reporter: Dmitry Ryabtsev Assignee: Benjamin Murphy
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-23330 Optimize aggregation on sharded setup... Closed
Related
related to SERVER-21064 It's possible to fail on sort memory ... Closed
is related to SERVER-27707 findAndModify breaks when I use the q... Closed
is related to SERVER-12024 re-implement $in in terms of $or Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 12 (04/04/16), Query 13 (04/22/16)
Participants:
Linked BF Score: 0

 Description   

Query shapes like {a: { "$in": [1]}, b:1, c: { "$in": [1,2,3]}} and {a: 1, b:1, c: { "$in": [1,2,3]}} are cached separately while they are equivalent.

It may not be a big problem, but mongod could be smart enough to recognize this.



 Comments   
Comment by Githook User [ 11/Apr/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-21065 Fixed use-after-free in canonical_query_test.cpp.
Branch: master
https://github.com/mongodb/mongo/commit/0a5732f6b65563f9d600578c9101cc2082f117f0

Comment by Max Hirschhorn [ 09/Apr/16 ]

Re-opening this ticket so that the heap-use-after-free in canonical_query_test can be addressed.

Comment by Githook User [ 07/Apr/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-21065 CanonicalQuery::normalizeTree optimizes InMatchExpression with one child.
Branch: master
https://github.com/mongodb/mongo/commit/723acb4f039f2431f5a315f4f4fe0151a63da825

Comment by David Storch [ 23/Oct/15 ]

SERVER-12024 could be one good way to solve this.

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