title: Adding a date filter in cosmos db not performant
body: <p>I have a cosmos db with 4164634 items currently in it. Each one is along the lines of:</p>
  
  <pre><code>  {
          "id": "b1bd4070-7df3-4e04-a6b2-4284f3e104f6",
          "jobId": "123",
          "clientID": 1,
          "eventDetails": {
              "Date": "2020-01-16T16:31:45",
              "Type": "Click",
              "PageUrl": "some url",
              "IPAddress": "100.100.100.0",
              "Source": "Foo"
          }
      }
  </code></pre>
  
  <p>If I do a query without a date filter. e.g.</p>
  
  <pre><code>SELECT DISTINCT c.jobId FROM c 
  WHERE c.eventDetails.Source = 'Foo'
  </code></pre>
  
  <p>The RU charge is quite reasonable at around 17 RUs. The response time is also quite quick an has an index lookup time of 0.28 ms.</p>
  
  <p>However if I add a date filter in. e.g.</p>
  
  <pre><code>SELECT DISTINCT c.jobId FROM c 
  WHERE c.eventDetails.Source = 'Foo' 
  AND (c.eventDetails.Date BETWEEN '2020-02-01' and '2020-02-29')
  </code></pre>
  
  <p>Then the RU charge goes up to 12397 RUs. It's also slower with an index lookup time of 19516.1499 ms. Despite the fact the second is going to result in a much much smaller result set.</p>
  
  <p>The indexes are the default to index everything and no additional composite indexes have been configured.</p>
  
  <p>Can someone explain why it takes so much more processing and what I can do to optimize?</p>