[SERVER-65489] Investigate replacing terminal unwind of foreign key in $lookup with a conditional one Created: 12/Apr/22 Updated: 29/Oct/23 Resolved: 25/Apr/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc2, 6.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Irina Yatsenko (Inactive) | Assignee: | Irina Yatsenko (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Backport Requested: |
v6.0
|
||||
| Sprint: | QE 2022-05-02 | ||||
| Participants: | |||||
| Description |
|
Currently, if the terminal value in the foreign key is a scalar, we'll add the scalar to the stream of foreign key values twice, first from the unwind and then as a "whole value". We should investigate whether making the unwind conditional on the terminal being an array would improve perf of NLJ. |
| Comments |
| Comment by Githook User [ 25/Apr/22 ] |
|
Author: {'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}Message: (cherry picked from commit 55c81877e5c873f0aa66603552ea4bab8e5caec9) |
| Comment by Irina Yatsenko (Inactive) [ 22/Apr/22 ] |
|
The change provides a considerable performance improvement (up to 30% in some micro-benchmarks) in $lookup queries with scalar foreign keys. |
| Comment by Githook User [ 22/Apr/22 ] |
|
Author: {'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}Message: |