[SERVER-73615] [CQF] Update Cascades properties based on ConstEval inlining decisions Created: 03/Feb/23  Updated: 29/Oct/23  Resolved: 15/Mar/23

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

Type: Bug Priority: Major - P3
Reporter: Matt Boros Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2023-03-06, QO 2023-03-20
Participants:

 Description   

During constant evaluation, if we see a variable whos definition is simply another variable, we currently would substitute in the definition. However this causes issues for our projection properties, since the substituted variable may not be allowed in a scope higher up. This is only an issue in the ConstEvalPost phase.

The lowering phase also handles this case. Instead of inlining before lowering, we can avoid doing the rewrite and recomputing the projections, and allow lowering to do the work for us.

repro:

coll.createIndex({a: 1, _id: 1})
coll.find({_id : 1}, {a : 1}).hint({a : 1, _id : 1})

The error will be "Location4946301 undefined slot accessor:2", caused by a rewrite in ConstEvalPost, which prevents the nested loop join from passing slot2 and slot3 further up in the plan.

slack conversation for reference

As part of this ticket, the SBE consteval equivalent should also be investigated.



 Comments   
Comment by Githook User [ 15/Mar/23 ]

Author:

{'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com', 'username': 'svilen-mihaylov'}

Message: SERVER-73615 [CQF] Update Cascades properties based on ConstEval inlining decisions
Branch: master
https://github.com/mongodb/mongo/commit/f25a9706e2aa5f34885c39dac9c12cac288fb019

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