[SERVER-77186] [CQF] Better explain for physical rewrite rule Created: 16/May/23  Updated: 29/Oct/23  Resolved: 24/May/23

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

Type: Bug Priority: Major - P3
Reporter: Svilen Mihaylov (Inactive) Assignee: Chi-I Huang
Resolution: Fixed Votes: 0
Labels: bonsai-onboarding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2023-05-29
Participants:

 Description   

Currently the rule is displayed under the physicalNodeId and applies to the best plan. We should be displaying rules for rejected plans as well if we track them. For example currently we have:

 

physicalNodeId: 3, costLimit: {Infinite cost}, rule: SargableToIndex
            Physical properties:
                projections: 
                    pa
                    pb
                distribution: 
                    type: Centralized
                indexingRequirement: 
                    Index, dedupRID
            cost: 0.0213882, localCost: 0.0213882, adjustedCE: 18.1659, node: 
                IndexScan [{'<indexKey> 0': pa, '<indexKey> 1': pb}, scanDefName: c1, indexDefName: index1, interval: {(Const [0 | 0], Const [0 | maxKey]]}]
                    ce: 18.1659
            rejectedPlans: 
                cost: 0.453393, localCost: 0.194114, adjustedCE: 18.1659, node: 
                    Filter []
                        ce: 18.1659
                    |   EvalFilter []
                    |   |   FunctionCall [getArraySize] 
...

We should be displaying rules under the best plan (IndexScan) and the rejected one (Filter plan). SargableToIndex applies only to the best node. The filter node rooted plan should be annotated as having an RIDIntersectGroupBy rule



 Comments   
Comment by Githook User [ 24/May/23 ]

Author:

{'name': 'Chi-I Huang', 'email': 'chii.huang@mongodb.com', 'username': 'chiihuang'}

Message: SERVER-77186 Print rewriter rule for each physical node in rejected plans
Branch: master
https://github.com/mongodb/mongo/commit/0c726eeb8680d01534b2776a79d124d2bbfa1247

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