Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41594

Covered query don't use index for range $gt+$lt. Only for one side and FETCH filter for another

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.9, 4.0.10
    • Component/s: Index Maintenance
    • Labels:
      None

      There is field contracts, that contain array of objects, that objects have indexed string field dateSigned (example value "2016-09-23T18:02:00+02:02"). Query with count and $lt (same for $gt) use index and all works great, stage COUNT_SCAN. But query with both $gt and $lt use index only for one bound and FETCH for another, that cause very poor perfomence.

      Why index can't use both bounds?

      Also I try to convert string value of dateSigned to ISODate, add new field dateSignedDate. Create index on that field - works same way.

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            devbocharov Bocharov Vladislav
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: