[SERVER-18013] Expose more execution stats from plan cache introspection commands Created: 13/Apr/15  Updated: 20/May/15  Resolved: 20/May/15

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

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

Issue Links:
Duplicate
duplicates SERVER-13220 Add and expose statistics to new quer... Backlog
Related
related to SERVER-13220 Add and expose statistics to new quer... Backlog
related to SERVER-18466 Log when and why a query shape begins... Closed
Participants:

 Description   

We should improve presentation of historical data for a query shape. This could involve either exposing different information from executions of the shape, or changing which historical data we hold onto.

We may want to include the particular query values for each instance of the shape. The current implementation discards the values for each instance of the shape after the first.



 Comments   
Comment by David Storch [ 20/May/15 ]

Closing as a dup of SERVER-13220

Comment by Thomas Rueckstiess [ 29/Apr/15 ]

Tracking the following stats per query shape, and exposing the stats in aggregated form would be very useful:

  • how often was this query shape executed since X
  • min/max/mean/median/95-percentile time spent executing this query shape since X
  • total sum of time the database spent executing this query shape since X

X could be last restart, last hour, last day, or a user definable window.

Rationale: with this information, it's usually straight-forward to see which query patterns are least efficient and cause the most work for the database, and which indexes need to be build to improve performance.

For reference, here is an example of how mtools presents this information, gathered from a log file.

Ideally, the results can be grouped by different granularities:

  • by query shape
  • by query shape + operation (i.e. query, update, remove, findAndModify, count, every command that can take a query)

And in the case where operation == "query":

  • by query shape + sort shape
  • by query shape + sort shape + projection
Generated at Thu Feb 08 03:46:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.