Skip to content

[Feature] (All) logical optimizers should optimize subqueries #2480

Open
@jon-chuang

Description

@jon-chuang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions