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

Unused index-boundaries on multikey

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.2
    • Component/s: Index Maintenance, Querying
    • Labels:
      None
    • Environment:
      Ubuntu 12.04, 12.10
    • ALL
    • Hide

      Create a collection with documents having a ISODate-column in the root document, and a collection of embedded documents with some criteria in each of the embedded document, and try to perform a query including both a range of dates, and a value for the embedded field.

      Show
      Create a collection with documents having a ISODate-column in the root document, and a collection of embedded documents with some criteria in each of the embedded document, and try to perform a query including both a range of dates, and a value for the embedded field.

      Given the index
      {
      "v" : 1,
      "key" :

      { "pricings.parent_id" : 1, "start_at" : 1 }

      ,
      "ns" : "accounts.calls",
      "name" : "pricings.parent_id_1_start_at_1"
      }

      The query
      {
      "start_at":

      { "$gte": ISODate("2012-10-15"), "$lt": ISODate("2012-10-15 08:00") }

      ,
      "pricings.parent_id": 4
      }
      fails to use the upper bounds for start_at.

      The explain() is;
      {
      "cursor" : "BtreeCursor pricings.parent_id_1_start_at_1",
      "isMultiKey" : true,
      "n" : 2526,
      "nscannedObjects" : 349468,
      "nscanned" : 349468,
      "nscannedObjectsAllPlans" : 349468,
      "nscannedAllPlans" : 349468,
      "scanAndOrder" : false,
      "indexOnly" : false,
      "nYields" : 0,
      "nChunkSkips" : 0,
      "millis" : 550,
      "indexBounds" :

      { "pricings.parent_id" : [ [4,4] ], "start_at" : [ [ ISODate("2012-10-15T00:00:00Z"), ISODate("292278995-01--2147483647T07:12:56.808Z") ] ] }

      ,
      "server" : "onatopp:27017"
      }

            Assignee:
            aaron Aaron Staple
            Reporter:
            rawler Ulrik Mikaelsson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: