title: compound Index or single index in mongodb
body: <p>I got a query like this that gets called 90% of the times:</p>
  
  <p>db.xyz.find({ "ws.wz.eId" : 665 , "ws.ce1.id" : 665)</p>
  
  <p>and another one like this that gets called 10% of the times:</p>
  
  <p>db.xyz.find({ "ws.wz.eId" : 111 , "ws.ce2.id" : 111)</p>
  
  <p>You can see that the id for the two collections in both queries are the same.
  Now I'm wondering if I should just create a single index just for "ws.wz.eId" or if I should create two compound indexes: one for {"ws.wz.eId", "ws.ce.id"} and another one for {"ws.wz.eId", "ws.ce2.id"}</p>
  
  <p>It seems to me that the single index is the best choice; however I might be wrong; so I would like to know if there is value in creating the compound index, or any other type.</p>