[SERVER-81863] Avoid a scan of either IDX or a collection if the filter is $alwaysFalse: Created: 04/Oct/23 Updated: 15/Nov/23 Resolved: 15/Nov/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: | Peter Volk | 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 | ||||||||||||||||||||||||
| Sprint: | QO 2023-10-16, QO 2023-10-30, QO 2023-11-13, QO 2023-11-27 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Linked BF Score: | 56 | ||||||||||||||||||||||||
| Description |
|
For the case that a find() has an $alwaysFalse: 1 condition (after Boolean optimization) the query should not be inspecting any documents at all. Instead the planner should generate a plan returning an empty set. The corresponding test is:
|
| Comments |
| Comment by Githook User [ 14/Nov/23 ] |
|
Author: {'name': 'Carlos Alonso', 'email': 'calonso@users.noreply.github.com', 'username': 'calonso'}Message: If we're resorting to collection scan and the predicate is trivially false then we're producing an EOF plan. |