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

Query optimizer should always use equality predicate over unique index when possible

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.5
    • Fix Version/s: 2.6.8, 3.0.0-rc6
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:

      Description

      After upgrading sharded cluster (shard key {uid:1}) from 2.4.9 to 2.6.5 I've began to notice periodic and sudden significant performance drops caused by huge read queue and lock on different shards. Logs shows slow queries like this:

      <skpd> query mpfs.hidden_data query: { _id: "5120d6d1c7624f319c35fdff9e596890", uid: "230984277" } planSummary: IXSCAN { uid: 1.0 } ntoskip:0 nscanned:28184 nscannedObjects:28184 keyUpdates:0 numYields:220 locks(micros) r:797191 nreturned:1 reslen:374 7134ms

      This collection has indexes {uid: 1} and {_id: 1}, and in normal situation, queries like that uses "_id" index that is the fastest one.

      This problem seems to be very similar to SERVER-13675 but it's marked as fixed in 2.6.2.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                8 Vote for this issue
                Watchers:
                22 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: