[SERVER-3493] count command should give indexinfo Created: 27/Jul/11 Updated: 10/Dec/14 Resolved: 15/Oct/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Querying |
| Affects Version/s: | 1.8.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | ttt | Assignee: | David Storch |
| Resolution: | Duplicate | Votes: | 7 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
centos x64 mongo-10gen-server-1.8.2-mongodb_1 |
||
| Issue Links: |
|
||||||||
| Operating System: | Linux | ||||||||
| Participants: | |||||||||
| Description |
|
> db.index.find().count().explain(); other ways to call count with explain i have tried also fail similarly. how do i know if mongod optimizes count query correctly if i can't "explain" it? |
| Comments |
| Comment by David Storch [ 15/Oct/14 ] | ||||||
|
Explain work being done under | ||||||
| Comment by Nic Cottrell (Personal) [ 12/Aug/14 ] | ||||||
|
I'm suddenly getting very slow results for count after upgrading 2.6.3->2.6.4. Query is like:
| ||||||
| Comment by Sylvain Zimmer [ 31/Jan/14 ] | ||||||
|
The issue I'm having now is very slow counts on big collections, even if they query only indexed fields by exact values. It's pretty hard to debug because find().explain() timeouts. If I do find().limit(10).explain() I do see the index being used but it still leaves me wondering what's happening with the counts! So, some kind of way to debug slow counts besides doing find().explain() would be very helpful. Thanks, | ||||||
| Comment by Christopher Price [ 01/Dec/11 ] | ||||||
|
How do we know for sure that it is using the same index? | ||||||
| Comment by Eliot Horowitz (Inactive) [ 27/Jul/11 ] | ||||||
|
In general count() uses the same index as a normal query. |