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

Single interval query keysExamined information is inaccurate

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 5.0.14
    • None
    • None
    • Query Execution
    • ALL
    • Hide

      Create a replica set.

      use mydb;
       
      db.coll.createIndex({a:1});
       
      db.coll.insert({a:1})
       
      db.coll.insert({a:false})
       
      db.coll.insert({a: ""})
       
      db.coll.find({a:{$gte:1}}).explain("allPlansExecution"); //  keysExamined = 1
       
      db.coll.find({a: {$in:[1, 2]} }).explain("allPlansExecution"); //  keysExamined = 2
      

      The above two queries should scan 2 documents:

      {a:1}

      and

      {a: ""}

      But the single interval query will only show keysExamined as 1.

       

      Show
      Create a replica set. use mydb;   db.coll.createIndex({a:1});   db.coll.insert({a:1})   db.coll.insert({a:false})   db.coll.insert({a: ""})   db.coll.find({a:{$gte:1}}).explain("allPlansExecution"); //  keysExamined = 1   db.coll.find({a: {$in:[1, 2]} }).explain("allPlansExecution"); //  keysExamined = 2 The above two queries should scan 2 documents: {a:1} and {a: ""} But the single interval query will only show keysExamined as 1.  

    Description

      When using a single interval query, the number of scanned keys displayed by explain is inaccurate. 

      If the traversed data no longer meets the requirements , and the returned kv is empty code.

      keysExamined will not increase. code

      But multi-range queries use other methods to check bounds code

      keysExamined data can be counted correctly.

       

       

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            1321280378feng@gmail.com Chao Yin
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: