[SERVER-83883] Simplify elemMatch expressions containing one single trivially false component to alwaysFalse Created: 05/Dec/23 Updated: 13/Dec/23 Resolved: 13/Dec/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.3.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Carlos Alonso Pérez | Assignee: | Carlos Alonso Pérez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 120 | ||||||||
| Description |
|
The definition of an $elemMatch expression is that it matches docs in where all its components are true, hence as soon as one is false the doc is filtered out. That means we can optimize
to
|
| Comments |
| Comment by Githook User [ 12/Dec/23 ] |
|
Author: {'name': 'Carlos Alonso', 'email': 'c.alonso@mongodb.com', 'username': 'calonso'}Message: GitOrigin-RevId: 9a852c75bc9e81123ab6566251ae07d23d2fb64d |