[SERVER-49469] explain executionStats for $unionWith incorrectly shows COLLSCAN for inner pipeline Created: 13/Jul/20 Updated: 29/Oct/23 Resolved: 12/Aug/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 4.4.0-rc13 |
| Fix Version/s: | 4.7.0, 4.4.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Ted Tuckman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | qopt-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||
| Sprint: | Query 2020-08-10, Query 2020-08-24 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
Note that index stats on testcoll1 show the index access get incremented so I believe that the error is somewhere in massaging output for executionStats for $unionWith stage. Note that the filter is missing (no parsedQuery). |
| Comments |
| Comment by Githook User [ 11/Sep/20 ] | |||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}Message: (cherry picked from commit 274192ab7d429710e0f69f0b1d922005fca9d516) | |||||||||||||||||||||||||||||||||||
| Comment by Ted Tuckman [ 20/Aug/20 ] | |||||||||||||||||||||||||||||||||||
|
I had the wrong ticket number in the message. Author: {'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}Message: | |||||||||||||||||||||||||||||||||||
| Comment by Ted Tuckman [ 12/Aug/20 ] | |||||||||||||||||||||||||||||||||||
|
This changed the unionWith explain output, anything depending on that may have to be changed. | |||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 13/Jul/20 ] | |||||||||||||||||||||||||||||||||||
|
A few tests show that it's only the $cursor stage inside $unionWith that doesn't return correct results, if there are subsequent stages in the $unionWith pipeline they seem to show correct number of documents passing through/returned. | |||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 13/Jul/20 ] | |||||||||||||||||||||||||||||||||||
|
Note that if you insert a document into testcoll1 that matches you get executionStats that ends like this (abbreviated/removed some fields):
| |||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 13/Jul/20 ] | |||||||||||||||||||||||||||||||||||
|
Note that results from the pipeline are correct, and results from bare explain are correct. The only incorrect output is from executionStats (and even then it looks like the index is found and used during planning but somehow the wrong thing gets printed out) |