[SERVER-79782] In slotBasedPlan explain output, sort env slots by id Created: 07/Aug/23  Updated: 29/Oct/23  Resolved: 07/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Improvement Priority: Minor - P4
Reporter: Ivan Fefer Assignee: Ivan Fefer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Sprint: QE 2023-08-21
Participants:

 Description   

For example, here is a plan for index scan with multiple index bounds: 

            slotBasedPlan: {
              slots: `$$RESULT=s22 env: { s10 = Nothing, s2 = IndexBounds(...), s21 = true, s6 = {...} }`,
              stages: '[2] nlj inner [] [s16, s17, s18, s19, s20] \n' +
                '    left \n' +
                '        [1] branch {s21} [s16, s17, s18, s19, s20] \n' +
                '        [s1, s3, s4, s5, s6] [1] ixscan_generic ... \n' +
                '        [s7, s13, s14, s15, s6] [1] nlj inner [] [s8, s9] \n' +
                         ...
                '    right \n' +
                '        [2] limit 1 \n' +
                '        [2] seek s16 s22 s23 s17 s18 s19 s20 none none [] @"c0824ba7-b8ce-4efa-9475-e97061c16fae" true false \n'
            } 

There is an important branch on s21 in the plan. But it is hard to find the value of s21 in env, because it is not sorted by id. It is even harder in practice, as I have shorted some parts of the plan

 



 Comments   
Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-79782 Sort slots in slotBasedPlan.slots.env explain output
Branch: master
https://github.com/mongodb/mongo/commit/73e255308e5ea944dfdf967df982274af7b09870

Generated at Thu Feb 08 06:41:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.