[SERVER-69795] Use empty array counter for CE for PathArr in SargableNode Created: 19/Sep/22 Updated: 29/Oct/23 Resolved: 12/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Alya Berciu | Assignee: | Timour Katchaounov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | M2 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | QO 2022-10-17 |
| Participants: |
| Description |
|
When estimating an $elemMatch predicate, the requirements map of a Sargable node may include a special 'PathArr' predicate that signals we should estimate this field using $elemMatch semantics. This predicate may be split out into its own SargableNode during the MemoExploration phase. When this happens, we need a special case in order to get a correct estimate when we see a Sargable node with just a requirements map entry like PathGet "a" PathIdentity [array interval]. We should use a counter of empty arrays in statistics to obtain a reasonable estimate for the proportion of arrays we expect in the output of the SargableNode. |
| Comments |
| Comment by Githook User [ 13/Oct/22 ] |
|
Author: {'name': 'Timour Katchaounov', 'email': 'timour.katchaounov@mongodb.com', 'username': 'timourk'}Message: Fix linter error. |
| Comment by Timour Katchaounov [ 12/Oct/22 ] |
|
svilen.mihaylov@mongodb.com could you give us some more information about PathObj? Few examples perhaps. I wasn't aware until this comment that we have to estimate it as an interval. I will file a ticket once you provide some more details (asked below). Do you mean that PathObj can also end up alone in a SargableNode as a special interval? How do we recognize its special interval? If so, we should be able to estimate it via the type counter for objects. |
| Comment by Githook User [ 12/Oct/22 ] |
|
Author: {'name': 'Timour Katchaounov', 'email': 'timour.katchaounov@mongodb.com', 'username': 'timourk'}Message: |