[SERVER-69149] Make debug print of SBE expressions more readable Created: 25/Aug/22 Updated: 29/Oct/23 Resolved: 23/Sep/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | David Storch |
| 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 | ||||||||
| Sprint: | QE 2022-09-19, QE 2022-10-03 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 146 | ||||||||
| Description |
|
As part of our efforts to improve the performance of the SBE engine, we are trying to change our plan generation logic so that instead of generating large subtrees of PlanStages, we instead generate large EExpression trees. This comes with a performance benefit, since we've found that it's cheaper to interpret the bytecode generated from EExpression trees than interpreting PlanStage trees (which involves a long chain of getNext() virtual function calls). Although such changes improve the performance of the engine, it reduces debuggability. The debug print for PlanStage uses newlines and spacing to show the tree structure. In contrast, EExpression debug print produces a long wall of text like this:
We could improve this by rendering the EExpression tree with newlines and potentially some delimiters to indicate the beginning and end of expressions. |
| Comments |
| Comment by Githook User [ 23/Sep/22 ] | |||||||||||||||||||||||||||||||||
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: Reapplies the original change with a corrected out-of-bounds | |||||||||||||||||||||||||||||||||
| Comment by xgen-buildbaron-user [ 23/Sep/22 ] | |||||||||||||||||||||||||||||||||
|
Ticket re-opened due to revert. write_concern_majority_passthrough began a consistent failure of jstests\core\distinct_with_hashed_index.js | |||||||||||||||||||||||||||||||||
| Comment by Githook User [ 23/Sep/22 ] | |||||||||||||||||||||||||||||||||
|
Author: {'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com'}Message: Revert " This reverts commit fd15b0d0ef92e32bc3ce60742ffe6a5337269bff. | |||||||||||||||||||||||||||||||||
| Comment by Githook User [ 22/Sep/22 ] | |||||||||||||||||||||||||||||||||
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: Also improves debug print of the SBE union stage. | |||||||||||||||||||||||||||||||||
| Comment by David Storch [ 16/Sep/22 ] | |||||||||||||||||||||||||||||||||
|
I typed up a quick and rather arbitrary example I can use to test out what a nice rendering of SBE expressions could look like:
The output from the master branch looks like this:
|