Open
Description
Describe the solution you'd like
Logical optimizer only walks LogicalPlan node inputs. However, realistically, every optimizer should now also walk every subquery by matching on Filter(Filter { expr: conjunction(vec![.., InSubquery/Exists { subquery }, ..] }
and optimize the subquery too.
One solution may be to declare subqueries as one of the inputs to the plan nodes...? However, this may "denormalize" certain things, so it may be better to add a helper function (based on e.g. visit/accept) that makes it easy for all optimizations to detect and walk subqueries.