[SERVER-71524] [CQF] Invalid index scan plan constructed for compound query Created: 21/Nov/22 Updated: 29/Oct/23 Resolved: 20/Dec/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hana Pearlman | Assignee: | David Percy |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | auto-reverted | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | QO 2022-12-12, QO 2022-12-26 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 162 | ||||||||
| Description |
|
I have a set of documents that I insert into a collection, I create a compound index {a: 1, x: 1} and then I run a query:
The optimizer constructs a plan which fails to match the following document:
The plan chosen by the optimizer is an index scan followed by two filters, one for the a.b predicate and one for the a.x predicate, and then the fetch comes later. The problem is that the two filter are applied to the index keys, so only a key that matches both predicates under the $and will pass the filters. But, if ‘a’ is an array, it may have multiple index keys, one which satisfies the first filter and one which satisfies the second. This would match in classic. |
| Comments |
| Comment by Githook User [ 12/Dec/22 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |
| Comment by xgen-buildbaron-user [ 08/Dec/22 ] |
|
Ticket re-opened due to revert. run_unittests began a consistent failure of build/install/bin/optimizer_test |
| Comment by Githook User [ 08/Dec/22 ] |
|
Author: {'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com'}Message: Revert " This reverts commit afcba3c5c0d7214ea222dc7e56a897864023aabe. |
| Comment by Githook User [ 07/Dec/22 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |
| Comment by Githook User [ 07/Dec/22 ] |
|
Author: {'name': 'Sviatlana Zuiko', 'email': 'sviatlana.zuiko@mongodb.com', 'username': 'szuiko'}Message: Revert " This reverts commit c6028eadf56b1774688da9d188d3180af3b91cea. |
| Comment by Githook User [ 07/Dec/22 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |