Query: consider pruning orderby from subquery projection if we don't end up using it on the outside
Open
area-query
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
Issue pointed out by @roji
Example query:
```cs
ss.Set().OrderBy(x => x.FullName).Take(10)
```
result sql:
```sql
@__p_0='10'
SELECT COUNT(*)
FROM (
SELECT TOP(@__p_0) [g].[Nickname], [g].[SquadId], [g].[FullName]
FROM [Gears] AS [g]
ORDER BY [g].[FullName]
) AS [t]
```
we don't end up needing the order by FullName anywhere (because count), so we technically don't need it in the subquery projection
Contributor guide
Assessment
This issue has not been assessed yet.