[SERVER-18480] explain("executionStats") hangs / does not return anything Created: 14/May/15  Updated: 18/Jun/15  Resolved: 18/Jun/15

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

Type: Bug Priority: Major - P3
Reporter: Mike Javadi Assignee: Ramon Fernandez Marina
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

mongod 3.0.2, sharded collection with 2.72B documents.

running a query with db.col.explain("executionStats").find(querydoc).sort(sortdoc) does not return any data even if wait hours. db.col.find(querydoc).sort(sortdoc) would work after a few seconds. Similarly, if you do a :

db.col.find(querydoc).sort(sortdoc).explain() , you will get results after a few seconds, where db.col.find(querydoc).sort(sortdoc).explain("executionStats") just hangs.



 Comments   
Comment by Ramon Fernandez Marina [ 27/May/15 ]

mjavadi, I tried to reproduce this behavior on my end, and what I observed is that gathering executionStats on such a large collection is bound to take a long time (specially if you're running a very slow query).

If you're interested in stats I would suggest adding a batch size to see the stats for a subset of your documents; for example:

db.col.find(querydoc).sort(sortdoc).batchSize(1000000).explain("executionStats") 

Can you try the above and see if it meets your needs?

Thanks,
Ramón.

Comment by Ramon Fernandez Marina [ 14/May/15 ]

It may not be uncommon for this operation to take a long time in such a large document. Can you please run db.col.find(querydoc).sort(sortdoc).explain("executionStats") and, while that's running, run db.currentOp(true) from another shell and post the output? Having two samples of db.currentOp(true) spaced out, for example, one minute apart may show whether the operation is stuck or making any progress.

Thanks,
Ramón.

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