Skip to content

Query: Improve how SelectExpression performs join to preserve sufficient metadata for binding #8094

Closed

Description

@smitpatel

At present our code to lift subquery is not streamlined. We have QueryModelVisitor.IsLiftable flag after which we also have other checks which determines if we can lift subquery or not. And even after all these checks, we still sometimes fails to lift subquery during joins.

Moreover the way our AddJoinFamily works is, it takes the first table from inner select expression and add it as joinexpression. This is in a way side effect of LiftSubQuery method which pushes down the select expression if is not identity query. When joins are lifted this all works fine but when join is not lifted, we end up with a select expression which was pushed down even if it was not required to.

We should be more accurate about when we want to push down subquery. We should do it only when we need it especially during AddJoin.

Activity

  1. added this to the 2.0.0 milestone on Apr 7, 2017
  2. tuespetre commented on Apr 11, 2017

    @tuespetre
    Contributor

    Hmmmmm :trollface:

  3. modified the milestones: , 2.0.0 on Apr 19, 2017
  4. modified the milestones: 2.0.0, Backlog on Jun 29, 2017
  5. 28 remaining items

  6. smitpatel commented on Jan 25, 2019

    @smitpatel
    ContributorAuthor

    SelectExpression will do the join rather than trying to do it outside in order to have access to private members.

  7. smitpatel commented on Jun 5, 2019

    @smitpatel
    ContributorAuthor

    We have implemented this in new query pipeline. Now join are passed to SelectExpression for binding so that it can copy over internal metadata.

  8. modified the milestones: 3.0.0, on Jun 5, 2019
  9. modified the milestones: , 3.0.0 on Nov 11, 2019
  10. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions