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

Explain for distinct using collection scan reports incorrect values

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Query Execution
    • ALL

      (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.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: