-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Set operations: translate OrderBy/Take/Skip directly on set operation instead of pushing down #16244
Comments
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. dotnet#16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes dotnet#6812 Fixes dotnet#13196 Fixes dotnet#16065 Fixes dotnet#16165
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. #16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes #6812 Fixes #13196 Fixes #16065 Fixes #16165
positional works in order by clause? So if your concern is the unspeakable name for the union-ed expression, you can always reference it by position. |
@mburbea we actually don't really need positional - the union-ed expression does have a name. The difficulty is an EF Core implementation detail rather than an SQL issue, we simply don't have the infrastructure to make the ordering clause refer to the union-ed expression alias (or position for that matter). This shouldn't be a critical matter, probably mostly a matter of generating cleaner SQL, so we'll probably defer this for after 3.0. |
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. dotnet#16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes dotnet#6812 Fixes dotnet#13196 Fixes dotnet#16065 Fixes dotnet#16165
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. dotnet#16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes dotnet#6812 Fixes dotnet#13196 Fixes dotnet#16065 Fixes dotnet#16165
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. #16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes #6812 Fixes #13196 Fixes #16065 Fixes #16165
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. dotnet#16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes dotnet#6812 Fixes dotnet#13196 Fixes dotnet#16065 Fixes dotnet#16165
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. #16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes #6812 Fixes #13196 Fixes #16065 Fixes #16165
* Include/nav rewriting is now supported. * We now push down to subquery when OrderBy, Take or Skip are applied to set operations, to avoid using the hack where ColumnExpression with no table alias was used. #16244 was opened to track for post-3.0. * Added missing support for union over subselect projection mappings. * Added Other type to SetOperationType so that providers can define extra set operations (e.g. PostgreSQL `INTERSECT ALL`, `EXCEPT ALL`). Completes #6812 Fixes #13196 Fixes #16065 Fixes #16165
* We no longer allow ColumnExpression without table alias * Set operations over operands with different types have been disabled for now. * We now push down set operations into a subquery on Orderby, Skip or Take, which shouldn't be necessary (#16244). * Some test consolidation and cleanup. Continues #6812
* We no longer allow ColumnExpression without table alias * Set operations over operands with different types have been disabled for now. * We now push down set operations into a subquery on Orderby, Skip or Take, which shouldn't be necessary (#16244). * Some test consolidation and cleanup. Continues #6812
* We no longer allow ColumnExpression without table alias * Set operations over operands with different types have been disabled for now. * We now push down set operations into a subquery on Orderby, Skip or Take, which shouldn't be necessary (#16244). * Some test consolidation and cleanup. Continues #6812
See #17340 (comment) for an implementation proposal. |
We currently pushdown to subquery whenever an OrderBy, Take or Offset is applied to it - but these can be applied directly on the set operation, without a subquery (but see #16238 for Take on SqlServer).
For example, for test Select_Union_different_fields_in_anonymous_with_subquery, we currently translate to:
We should translate to:
The reason we don't currently do this, is that we have no good way for the ORDER BY clause to reference a column alias that has no table alias (
[Foo]
).The text was updated successfully, but these errors were encountered: