title: MongoDB aggregation: Performance of queries with both indexed and non-indexed fields
body: <p>Say I have a MongoDB collection of documents with only two fields - x and y - and one of them (say, x) has an index.</p>
  
  <p>Will any of the following queries will have better performance than the other?</p>
  
  <p>Single-match query:</p>
  
  <pre><code>db.collection.aggregate({$match : {x : "value", y : "value"}})
  </code></pre>
  
  <p>Double-match query (indexed field matched first):</p>
  
  <pre><code>db.collection.aggregate({$match : {x : "value"}}, {$match : {y : "value"}})
  </code></pre>