[SERVER-35139] Explain for distinct using collection scan reports incorrect values Created: 21/May/18  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Ian Boros Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: RF, query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Operating System: ALL
Participants:

 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.


Generated at Thu Feb 08 04:38:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.