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

Explain for distinct using collection scan reports incorrect values

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Querying
    • Query Execution
    • ALL

    Description

      (function() {
          db.c.insert({a:1});
          db.c.insert({a:1});
          printjson(db.c.explain("allPlansExecution").distinct("a"));
      })();
      

      $ resmoke.py --suites=core repro-file.js
      

      Currently nReturned will be 2 (rather than 1). If an index

      {a: 1}

      is created, then nReturned will be the correct value of 1.

      Once this is fixed, there may be special work we have to do to get this to work correctly under sharded clusters.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: