Do you need a leading column to be Indexed on Mongo DB ?
26 views
Skip to first unread message
Bhaskar Sarma
unread,
Jun 25, 2017, 4:09:47 AM6/25/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi Experts, I created a small collection chap2, with the following details, I created Index on col1 Column, when I try to query col1 I see the plan uses IXSCAN, Now when I try to use Col2,Col1 or Col1,Col2 I see the plan to be same. So does it really matter the order of columns in Index for Mongo ? or is it by case to case basis ?
Bhaskar.
Weishan Ang
unread,
Jun 27, 2017, 11:01:31 AM6/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
It does matter, if you look at the KeysExamined Vs KeysRetrieved, you will notice a difference in the ratio. The best ratio is, of course, 1:1.
Wan Bachtiar
unread,
Jun 28, 2017, 11:00:18 PM6/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message