[SERVER-3268] Attempting to count() a date query causes cursor to timeout Created: 15/Jun/11 Updated: 29/May/12 Resolved: 02/Sep/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Wes Widner | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB 1.8.1 |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
Querying a date with $gt and then attempting to run count() on the resulting cursor hangs. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 25/Jun/11 ] |
|
Can you run an explain on that query from the shell? |
| Comment by Scott Hernandez (Inactive) [ 23/Jun/11 ] |
|
Counts don't run on cursors. The count method at the end of that line issues a separate command (there is never a cursor created) to the server. In this case you want to call count(true) in the shell to apply the limit otherwise it will get the total count for the query (ignoring the limit). |