[SERVER-34200] Explain doesn't report stages which are above a MultiPlanStage Created: 29/Mar/18 Updated: 29/Oct/23 Resolved: 26/Feb/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Timour Katchaounov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Query Optimization 2021-02-22, Query Optimization 2021-03-08 |
| Participants: |
| Description |
|
When we have a plan like this:
Running explain() on the plan will "forget" to report about any stage above the MultiPlanStage. The cause of this problem is this code which is used when trying to explain the winning plan here. The questionable code searches the entire plan tree for a MultiPlanStage, and then returns whichever child of it is considered the "winning plan," discarding any stages above. I think the correct behavior would be to instead "replace" any MultiPlanStage with its best child. Here's a way of reproducing this (notice the explain output doesn't have a "COUNT" stage).
resmoke.py --suites=core count-bug.js To see what the correct output would be, you can comment out one of the ensureIndex calls. This will mean only one plan is available, and so no MultiPlanStage will be used. |
| Comments |
| Comment by Githook User [ 01/Mar/21 ] |
|
Author: {'name': 'Timour Katchaounov', 'email': 'timour.katchaounov@mongodb.com'}Message:
|
| Comment by Timour Katchaounov [ 01/Mar/21 ] |
|
david.storch I got advice from Anton. The task got stuck on one test, unrelated. I'll rebase and repeat. |
| Comment by David Storch [ 01/Mar/21 ] |
|
timour.katchaounov it looks like the githook didn't provide the github link to the commit? |