Skip to content

Combine the optimization rules decorrelate, decorrelate_lateral_join, and decorrelate_predicate_subquery into one. #16073

Open

Description

@irenjj

Is your feature request related to a problem or challenge?

related to: #16015

It would be really nice to figure out how to combine these passes into one unified set of decorrelation code -- now we have three passes

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. duongcongtoai commented on May 17, 2025

    @duongcongtoai
    Contributor

    Do you think this draft PR can combine all the rules?
    lateral join is not mentioned yet, but i think we can use the same data structure to reason the dependencies between the operator

    pub struct DependentJoinTracker {
        root: Option<usize>,
        // each logical plan traversal will assign it a integer id
        current_id: usize,
        // each newly visted operator is inserted inside this map for tracking
        nodes: IndexMap<usize, Operator>,
        // all the node ids from root to the current node
        // this is used during traversal only
        stack: Vec<usize>,
        // track for each column, the nodes/logical plan that reference to its within the tree
        accessed_columns: IndexMap<Column, Vec<ColumnAccess>>,
        alias_generator: Arc<AliasGenerator>,
    }
    
  2. irenjj commented on May 18, 2025

    @irenjj
    ContributorAuthor

    Cool! Thanks @duongcongtoai, maybe we can support lateral join after #16016 merged.

  3. alamb commented on May 18, 2025

    @alamb
    Contributor

    I really like the idea of using #16016 / #5492 to satisfy this goal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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