Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query: RequiresMaterializationExpressionVisitor issues #11215

Closed
smitpatel opened this issue Mar 9, 2018 · 4 comments
Closed

Query: RequiresMaterializationExpressionVisitor issues #11215

smitpatel opened this issue Mar 9, 2018 · 4 comments
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.

Comments

@smitpatel
Copy link
Member

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()
@ajcvickers ajcvickers added this to the Backlog milestone Mar 9, 2018
@smitpatel
Copy link
Member Author

  • 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.

@smitpatel
Copy link
Member Author

smitpatel commented Mar 23, 2018

  • 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

@smitpatel
Copy link
Member Author

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

@smitpatel
Copy link
Member Author

No more RequiresMaterializationExpressionVisitor

@smitpatel smitpatel removed this from the Backlog milestone Aug 15, 2019
@ajcvickers ajcvickers added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Mar 10, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.
Projects
None yet
Development

No branches or pull requests

2 participants