[SERVER-12630] incorrect nscannedObjects for $or Created: 05/Feb/14  Updated: 10/Dec/14  Resolved: 10/Feb/14

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

Type: Bug Priority: Minor - P4
Reporter: Daniel Pasette (Inactive) Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12529 incorrect explain output for covered ... Closed
Operating System: ALL
Participants:

 Description   

Saw this in repro'ing SERVER-12613. Stripped down version below.

db.col.drop();
db.col.insert({a:"test"});
db.col.ensureIndex({a:1});
 
var explainObj = db.col.find({ $or: [ { 'a' : "foo" }, { 'a' : "bar" } ] }).explain();
printjson( explainObj )
assert.eq(0, explainObj.nscannedObjectsAllPlans);
assert.eq(0, explainObj.nscannedAllPlans);
 
db.col.getPlanCache().clear();
 
explainObj = db.col.find({ $or: [ { 'a' : null }, { 'a' : null } ] }).explain();
printjson( explainObj )
assert.eq(0, explainObj.nscannedObjectsAllPlans);
assert.eq(0, explainObj.nscannedAllPlans);



 Comments   
Comment by hari.khalsa@10gen.com [ 10/Feb/14 ]

The null query is not exact and as such we have to look at each branch and the collscan when evaluating all plans.

Comment by David Storch [ 10/Feb/14 ]

Linking to SERVER-12529, as they look to be related.

Generated at Thu Feb 08 03:29:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.