[SERVER-5821] explain forces a negative limit but find does not Created: 11/May/12  Updated: 15/Feb/13  Resolved: 18/Sep/12

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

Type: Question Priority: Major - P3
Reporter: Aaron Staple Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:

 Description   

A limit passed to explain is forced to be negative

n._limit = Math.abs(n._limit) * -1;

But this is not the case with a find limit.

This can potentially cause confusion when explain queries do not behave the same as their non explain counterparts.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 18/Sep/12 ]

This is as it should be.
explain() does the full query.
find() uses cursors, so the first batch may be fast, but that's not what we should be measuring.
If we wanted, we could add a "time to first 100 docs" field in explain.

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