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

Presence of pipe '|' is search causes all keys to be examined

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.4
    • Querying
    • None
    • Fully Compatible
    • ALL
    • Hide
      1. setup system with 3.0.4
        1. mongo shell
        2. import enclosed dump file
        3. run "db.re.find({_id:/^\Q1234^mr^sjc|ENT\E/}).explain('executionStats')"
        4. check the "totalKeysExamined" field in output, should be 2 but is 9
        5. run "db.re.find({_id:/^\Q1234^mr^sjc\E/}).explain('executionStats')"
        6. check the "totalKeysExamined" field in output
      2. setup system with 2.6.9
        1. mongo shell
        2. import enclosed dump file
        3. run "db.re.find({_id:/^\Q1234^mr^sjc|ENT\E/}).explain('executionStats')"
        4. check the "nscanned" field in output, should be 2 but is 9
        5. run "db.re.find({_id:/^\Q1234^mr^sjc\E/}).explain('executionStats')"
        6. check the "nscanned" field in output
      Show
      setup system with 3.0.4 mongo shell import enclosed dump file run "db.re.find({_id:/^\Q1234^mr^sjc|ENT\E/}).explain('executionStats')" check the "totalKeysExamined" field in output, should be 2 but is 9 run "db.re.find({_id:/^\Q1234^mr^sjc\E/}).explain('executionStats')" check the "totalKeysExamined" field in output setup system with 2.6.9 mongo shell import enclosed dump file run "db.re.find({_id:/^\Q1234^mr^sjc|ENT\E/}).explain('executionStats')" check the "nscanned" field in output, should be 2 but is 9 run "db.re.find({_id:/^\Q1234^mr^sjc\E/}).explain('executionStats')" check the "nscanned" field in output

    Description

      There appears to be a regression with how the query processor handles the pipe character '|'. In version 3.0.4, regular queries using the pipe character scan all entries in the index. In version 2.6.9, regular queries using the pipe character DO NOT scan all entries in the index.

      Attachments

        Activity

          People

            Unassigned Unassigned
            steven.hand Steven Hand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: