[SERVER-12429] $maxScan w/query returns N-1 Created: 22/Jan/14  Updated: 22/Jan/14  Resolved: 22/Jan/14

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

Type: Bug Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

> db.mxscan.find()._addSpecial( "$maxScan" , 40 ).itcount()
40
> db.mxscan.find({nr:{$ne:0}})._addSpecial( "$maxScan" , 40 ).itcount()
39

Doesn't seem to matter if we have an index on "nr" or not.



 Comments   
Comment by Scott Hernandez (Inactive) [ 22/Jan/14 ]

I misunderstood, yes. Bad test data, not behavior.

Comment by Eliot Horowitz (Inactive) [ 22/Jan/14 ]

Same response...
If one doc doesn't match then that's what you'd expect.

Comment by Scott Hernandez (Inactive) [ 22/Jan/14 ]

If you increase $maxScan with the same query you continue to get N-1 results.

> db.mxscan.find({nr:{$ne:0}})._addSpecial( "$maxScan" , 105 ).itcount()
104
>db.mxscan.find({nr:{$ne:0}})._addSpecial( "$maxScan" , 100 ).itcount();
99

Comment by Eliot Horowitz (Inactive) [ 22/Jan/14 ]

Its not enough to tell from this if its a bug or not since those results could be correct based on data.

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