[SERVER-14064] Add planSummary information to count command Created: 27/May/14  Updated: 11/Mar/15  Resolved: 29/May/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.6.0
Fix Version/s: 2.6.2, 2.7.2

Type: Improvement Priority: Major - P3
Reporter: James Wahlin Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Backport Completed:
Participants:

 Description   
Issue Status as of Jun 9, 2014

ISSUE SUMMARY
When a count() operation takes longer than the specified value of slowms (100ms by default), the corresponding message in the log file contains information about the plan summary used in the query. Here are two sample log lines:

2014-06-09T17:30:10.759-0400 [conn4] command test.$cmd command: count { count: "foo", query: { x: { $gt: 12345.0 } }, fields: {} } planSummary: COLLSCAN keyUpdates:0 numYields:287 locks(micros) r:253415 reslen:48 154ms
2014-06-09T17:30:58.876-0400 [conn4] command test.$cmd command: count { count: "foo", query: { x: { $gt: 12345.0 } }, fields: {} } planSummary: COUNT { x: 1.0 } keyUpdates:0 numYields:165 locks(micros) r:133823 reslen:48 78ms

The first line of the log above shows a slow count() operation doing a collection scan:

planSummary: COLLSCAN

while the second shows a slow count() operation using the index {x: 1}:

planSummary: COUNT { x: 1.0 }

RELEASE VERSION
This improvement is included in the MongoDB 2.6.2 production release.

Original description

planSummary information is very useful in determining index usage when mongod prints slow operations to the logs. Please add to count command logging which is not present in 2.6.0.



 Comments   
Comment by Githook User [ 30/May/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-14064 provide planSummary for slow count commands
Branch: v2.6
https://github.com/mongodb/mongo/commit/b1950f5fa70b5ac93f83546f8a49e64e58a35a31

Comment by Githook User [ 29/May/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-14064 provide planSummary for slow count commands
Branch: master
https://github.com/mongodb/mongo/commit/d5ceac1d556806be15d7653b92268354f52bbeda

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