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

Query ignoring indexes in 2.6rc1

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc2
    • Affects Version/s: 2.6.0-rc1
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      Windows 8.1, php 5.4.4, php-mongo-driver 1.3.1, Mongo 2.6rc1
    • Windows

      After updating from 2.4.5 to 2.6rc1 in a local environment, we tested the next query:

      {
        "namespace" : "rsvcom",
        "active" : true,
        "$or" : [{
            "keywords.names" : /^hotel/
          }, {
            "keywords.extended" : {
              "$all" : [/^hotel/]
            }
          }],
        "searchable" : true,
        "type" : "EA"
      }
      

      The collection "suggest" has 2.414.690 documents with a size of 2.5gb and a index size of 3.4gb.

      The output of db.suggest.getIndexes() is here:
      https://gist.github.com/wiliame/4439872fa5e3741163d5

      And the issue comes with the index selector, the query is taking more than 20 seconds, sometimes some minutes to finish because is scanning all the documents.

      Explain of the query in the 2.6rc1:
      https://gist.github.com/wiliame/391289227b62871ab0e4

      Explain of the query in the 2.4.5:
      https://gist.github.com/wiliame/414c22f0c6f6981fbea9

      And the output is not the expected.

      To finish, this are some example documents:
      https://gist.github.com/wiliame/56c771b422f27fe0ed95

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            wiliam Wiliam
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: