[SERVER-52958] [SBE] Add support for the COUNT_SCAN stage to the SBE stage builders Created: 20/Nov/20 Updated: 29/Oct/23 Resolved: 02/Jun/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Drew Paroski | Assignee: | Zixuan Zhuang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | auto-reverted, qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||
| Sprint: | QE 2023-05-15, QE 2023-05-29, QE 2023-06-12 | ||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 1 | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
When I tried to run the "bestbuy_agg_query_comparison.js" benchmark (fromĀ https://github.com/10gen/workloads) with useAgg=true and with SBE mode enabled, the benchmark failed with an error message saying "Can't build exec tree for node: COUNT". I've created a simple example that reproduces the failure:
The goal of this task is to implement support for the COUNT stage so that these kinds of queries work correctly when SBE mode is enabled. |
| Comments |
| Comment by Githook User [ 27/Jun/23 ] |
|
Author: {'name': 'Zixuan', 'email': 'leozzx@users.noreply.github.com', 'username': 'leozzx'}Message: |
| Comment by Githook User [ 31/May/23 ] |
|
Author: {'name': 'Zixuan Zhuang', 'email': 'zixuan.zhuang@mongodb.com', 'username': 'leozzx'}Message: |
| Comment by xgen-buildbaron-user [ 31/May/23 ] |
|
Ticket re-opened due to revert. replica_sets_multi_stmt_txn_jscore_passthrough began a consistent failure of jstests/core/index/index_count_scan.js |
| Comment by Githook User [ 31/May/23 ] |
|
Author: {'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}Message: Revert " This reverts commit 0bc76a695b1128d34cc506e903b03bc325a25398. |
| Comment by Githook User [ 31/May/23 ] |
|
Author: {'name': 'Zixuan Zhuang', 'email': 'zixuan.zhuang@mongodb.com', 'username': 'leozzx'}Message: |
| Comment by Githook User [ 11/May/23 ] |
|
Author: {'name': 'Zixuan Zhuang', 'email': 'zixuan.zhuang@mongodb.com', 'username': 'leozzx'}Message: |
| Comment by David Storch [ 16/Mar/23 ] |
|
I'm re-opening this ticket for re-triage and clarified the title to indicate that this is specifically about the COUNT_SCAN QuerySolutionNode. The logic for selecting between the classic engine and SBE has changed quite a bit since this ticket was filed. Of particular relevance is If there is no columnstore index but any of the QuerySolution trees produced by the classic QueryPlanner have a COUNT_SCAN node, then we have special logic to bail out and fall back to the classic engine. This is notable because generally we select between the classic engine and SBE at a higher level, before doing any query planning. The presence of a COUNT_SCAN node is one of the few reasons that we can bail out of SBE after getting further into the planning process. For this reason – in addition to the more straightforward reasons that supporting more features in SBE is good for our engineering progress and often good for performance – now might be a good time to add support for COUNT_SCAN in the SBE stage builders. Note that I am not suggesting that we allow count commands to use SBE, but rather that we allow count-like aggregate commands which result in a COUNT_SCAN to use SBE. Hopefully it will be possible to provide a performant implementation of COUNT_SCAN in SBE without adding any new concepts to the core SBE engine. |