[SERVER-11184] Perf : merge consecutive calls to $match Created: 15/Oct/13  Updated: 11/Jul/16  Resolved: 21/Oct/13

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.5.4

Type: Improvement Priority: Major - P3
Reporter: Yann Moisan Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-14987 Combine multiple adjacent $match comm... Closed
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

I have an index on a and b :

{"a":1, "b":1}

If I use two consecutive $match'es in the pipeline, the index is used but only for the "a" part.
{$match:{"a":xxx}}, {$match:{"b":xxx}}

The server could optimize this case by internally merge the two match.



 Comments   
Comment by auto [ 21/Oct/13 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-11184 Merge consecutive $match stages in agg
Branch: master
https://github.com/mongodb/mongo/commit/c36cd416195ddcbf092480fdacdf0a0a081cc9c6

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