[SERVER-50246] $unionWith explain loses information from any stages in sub-pipeline which get absorbed into cursor stage Created: 11/Aug/20 Updated: 29/Oct/23 Resolved: 08/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0, 4.4.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ted Tuckman | Assignee: | Nicholas Zolnierz |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | qopt-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||||||||||||||||||
| Sprint: | Query 2020-09-07, Query 2020-09-21 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||||||
| Description |
|
When we explain a pipeline with mode "executionStats" or above, we first execute the pipeline to completion and then serialize the individual stages. If one of those stages is a $unionWith, then the first phase will target and optimize the sub-pipeline, absorbing any possible stages into the $cursor stage. When serialize() is subsequently called against the $unionWith to generate the 'stages' element of explain, we do the same process again except we've lost any stages which were pushed down into the $cursor/$mergeCursors. |
| Comments |
| Comment by Githook User [ 16/Sep/20 ] |
|
Author: {'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}Message: (cherry picked from commit 4edfad49d10c3f75cf1fbc2f909e424d79f4a7e1) |
| Comment by Githook User [ 08/Sep/20 ] |
|
Author: {'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}Message: |
| Comment by Nicholas Zolnierz [ 01/Sep/20 ] |
|
Marking as related to SERVER-22622, as they share a common theme of explaining pipelines which read/access multiple collections. |
| Comment by Nicholas Zolnierz [ 24/Aug/20 ] |
|
Re-titled to describe the issue. When we explain a pipeline with mode "executionStats" or above, we first execute the pipeline to completion and then serialize the individual stages. If one of those stages is a $unionWith, then the first phase will target and optimize the sub-pipeline, absorbing any possible stages into the $cursor stage. When serialize() is subsequently called against the $unionWith, we do the same process again except we lose any stages which were pushed down. In the test added by |