[SERVER-50428] Expose diagnostics to client queries Created: 20/Aug/20 Updated: 06/Dec/22 Resolved: 22/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Evan Broder | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Participants: | |||||||||
| Description |
|
Currently, the only way for clients to access query diagnostics is through the explain command; there's no way to access that information when issuing normal queries. We'd like to introduce a flag to find (and potentially other query commands) that includes some basic diagnostic information (keysExamined, docsExamined, hasSortStage, and ideally planSummary) as part of the query response. This enables building smarter clients that have a better understanding of their performance impact. As an example use case, we'd like background batch job clients to throttle themselves based on the load they generate on the database. In theory we could use number of queries issued or documents returned, but keysExamined, docsExamined, and hasSortStage are a much more precise indicator of the performance impact of queries. I put together a quick sketch implementation to demonstrate what the interface might look like. |
| Comments |
| Comment by Michael Gargiulo [ 17/Sep/20 ] |
|
evan@stripe.com I am going to leave this open and assign to the appropriate team. Since there are slight differences in this request from SERVER-1812 we may be able to address this separately. |
| Comment by Evan Broder [ 28/Aug/20 ] |
|
My bad, I didn't find that ticket when I was looking around, but yes it seems pretty similar. I think the biggest potential difference is that I don't need/particularly want a full explain plan, just the summary diagnostics. But if that's in line with the goals for SERVER-1812, happy to dup and move the discussion over there. |
| Comment by Asya Kamsky [ 28/Aug/20 ] |
|
This seems like a duplicate of SERVER-1812, no? |