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

Natural Sort ignores Index

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.4
    • Component/s: Index Maintenance
    • None
    • Environment:
      Capped Collection / 'rf' is sparse-indexed
    • Linux

      db.log.find(

      { rf : 'o-5556457634'}

      ).sort(

      { '$natural' : -1 }

      ).explain();
      {
      "cursor" : "ReverseCappedCursor",
      "nscanned" : 1654468,
      "nscannedObjects" : 1654468,
      "n" : 4,
      "millis" : 2932,
      "nYields" : 5,
      "nChunkSkips" : 0,
      "isMultiKey" : false,
      "indexOnly" : false,
      "indexBounds" : {}
      }

      Without the 'natural' sort:

      db.log.find(

      { rf : 'o-5556457634'}

      ).explain();
      {
      "cursor" : "BtreeCursor rf_1",
      "nscanned" : 4,
      "nscannedObjects" : 4,
      "n" : 4,
      "millis" : 0,
      "nYields" : 0,
      "nChunkSkips" : 0,
      "isMultiKey" : false,
      "indexOnly" : false,
      "indexBounds" : {
      "rf" : [
      [
      "o-5556457634",
      "o-5556457634"
      ]
      ]
      }

            Assignee:
            Unassigned Unassigned
            Reporter:
            userman99 Diego Maxi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: