[SERVER-53549] Added explain mode similar to "executionStats" but which will perform write operations Created: 31/Dec/20 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | MapReduce |
| Affects Version/s: | 4.4.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Alex Bevilacqua | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Sprint: | Query Execution 2021-03-08, Query Execution 2021-03-22, Query Execution 2021-04-05, Query Execution 2021-04-19, Query Execution 2021-05-03, Query Execution 2021-05-17 |
| Participants: | |
| Case: | (copied to CRM) |
| Description |
|
Running explain with "executionStats" will execute the chosen plan, but turns any write operations into no-ops. This makes it hard to gauge the impact of those writes on performance. Addition of an explain mode that behaves like "executionStats" but which also performs write operations would allow users to measure and explicitly opt-in to writes.
Previous Description: With MongoDB 4.4, the verbose option was removed (ignored if specified) which previously included timing details for the map and reduce phases of the command. The alternative provided by the docs is:
however when using the out option with explain the results won't actually be written to the target collection, which results in explain not providing the type of timing parity the verbose option gave users. For example:
The output of the above command in MongoDB 4.2 and 4.4 is as follows: MongoDB 4.2
MongoDB 4.4
By wrapping the mapReduce command in an explain, planner timing is produced:
The executionTimeMillisEstimate produced by the query planner does not provide the same map stage, nor reduce stage timing that was present prior to the MapReduce in Aggregation project being completed and introduced in MongoDB 4.3.3. With Some of the legacy code is summarized below in case this facilitates reintroduction of this functionality:
|
| Comments |
| Comment by James Wahlin [ 04/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reopening as this ticket was repurposed to be an aggregate command feature request. The mapReduce command was rewritten to use the aggregation framework, allowing for a more general purpose feature. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Esha Bhargava [ 04/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Closing these tickets as part of the deprecation of mapReduce. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 25/May/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After discussion in the triage meeting, adding this to the QE Backlog. This would be a good candidate for a future project that addresses various diagnostics improvements. CC ana.meza, to add this ticket as part of that new project when it's created. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex Bevilacqua [ 25/Jan/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
james.wahlin I think pivoting this discussion would yield a much more powerful (and useful) solution. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by James Wahlin [ 25/Jan/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
To kick off discussion on this, I am providing the following which demonstrates how a mapReduce specification is translated to an aggregation pipeline. This may help in mapping what were previously independent map and reduce steps into their underlying equivalent aggregation stages.
Given the above translation, while statistics could be generated to try to mirror our former map and reduce stages, I suspect they would be less useful than statistics on the component parts? Given that what may be missing here is an "executionStats"-like invocation of explain that executes on writes as well. alex.bevilacqua if this sounds reasonable, we could pivot this request to be for a new explain mode. |