QnaList > Groups > Mongodb-User > Apr 2016
faq

[mongodb-user] The Query Optimization Phase

I'm assuming mongodb has a query optimizer that determines whether to use 
an index or do a full collection scan,etc. If the $match clause appearing 
at the beginning of the pipeline has to match on multiple fields, does the 
order of the fields matter?  That is, are  { "$match":{"a":1,"b":2} } and { 
"$match":{"b":2,"a":1} } any different?
I've seen this page 
 from 
the docs. Are there any other resources where I can learn more about 
mongoDB's query optimizer? 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]
To post to this group, send email to [email protected]
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/eb9e9515-1523-42ad-af11-fc3cddd918b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asked Apr 9 2016 at 05:07

Madhumitha psg 's gravatar image



2 Replies for : [mongodb-user] The Query Optimization Phase
Have you seen either this page
<https://docs.mongodb.org/manual/core/query-optimization/> or this page
<https://docs.mongodb.org/manual/core/query-plans/>?
TL;DR order of clauses in the *query* does not matter.
Order does matter in compound indexes and in multi-field sorts.
Asya Kamsky
Lead Product Manager
MongoDB
Download MongoDB - mongodb.org/downloads
Free MongoDB Monitoring - cloud.mongodb.com
Free Online Education - university.mongodb.com
Get Involved - mongodb.org/community
We're Hiring! - https://www.mongodb.com/careers
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]
To post to this group, send email to [email protected]
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJBTaHcFNa_KHxkrPzxxxvJmDUT8UO1E6q3rhjSLt%2B6miQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

answered Apr 9 2016 at 19:33

Asya Kamsky 's gravatar image


Thanks!
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]
To post to this group, send email to [email protected]
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/58345793-f1d9-440c-891d-8b28490a71bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

answered Apr 9 2016 at 22:18

Madhumitha psg 's gravatar image


Related discussions

Tagged

Group Mongodb-user

asked Apr 9 2016 at 05:07

active Apr 9 2016 at 22:18

posts:3

users:2

©2013 QnaList.com