Skip to content

Query: RequiresMaterializationExpressionVisitor issues #11215

Closed as not planned
Closed as not planned

Description

@smitpatel

General issue for writing down, where we mark query source for materialization even though its not needed.

  • If GroupBy is not last result operator then even though we may not need to generate groupings, we still mark the query source inside the selector for materialization forcing us to do client groupby. See GroupBy_Distinct()

Activity

  1. added this to the Backlog milestone on Mar 9, 2018
  2. smitpatel commented on Mar 10, 2018

    @smitpatel
    ContributorAuthor
    • Presently during translation of GroupBy, we visit only element selector and discard SelectClause (since element selector defines what should go into group). But QSRM doesn't account for this due to lack of QMV backing it. Hence we visit selector & ElementSelector both but we can encountering GroupBy aggregate we cannot demote the selector because it not being QSRE (normal case when joining 2 querysources without explicit select. QSRM needs to consider this handling correctly. At present there is work-around for simple case here.

    • We should translate ConstantExpression in select clause to server if it is used in some aggregate or single value result. Since not translating it blocks the further translation. This could be useful in GroupBy scenario. It also has value without GroupBy case.

  3. smitpatel commented on Mar 23, 2018

    @smitpatel
    ContributorAuthor
    • Promoting a QuerySource for materialization also update the inner query source but that happens only if the inner is subquery expression with QSRE in selector. If Selector is anonymous type of multiple QSRE then we don't update them.
    • Since we don't have QueryModelVisitor backing it, we always promote query sources in selector (regardless of QSRE or NewExpression). We may need to demote it based on which part of outer QM we are.
    • Additional issue with above 2 is, when selector is being used in outer but outer itself is not getting materialized, we end up with wrong materialization info of inner. We cannot mark demote inner selector always because outer may not properly mark underlying ones.

    Some cases which are not properly identified surfaces in #11412

  4. smitpatel commented on May 24, 2018

    @smitpatel
    ContributorAuthor

    As a fix for this we can possibly remove the need of whole visitor.

  5. smitpatel commented on Aug 15, 2019

    @smitpatel
    ContributorAuthor

    No more RequiresMaterializationExpressionVisitor

  6. removed this from the Backlog milestone on Aug 15, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions