We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We currently translate the following LINQ query:
_ = ctx.Blogs .GroupBy(b => b.Id) .Select(g => new { g.Key, Count = g.Select(x => x.Name).Count(n => n != null) }) .ToList();
... to:
SELECT [b].[Id] AS [Key], COUNT(CASE WHEN [b].[Name] IS NOT NULL THEN 1 END) AS [Count] FROM [Blogs] AS [b] GROUP BY [b].[Id]
... when we could just translate to:
SELECT [b].[Id] AS [Key], COUNT([b].[Name]) AS [Count] FROM [Blogs] AS [b] GROUP BY [b].[Id]
... since COUNT(x) only counts non-null values. This may have a perf impact (index usage).
COUNT(x)
Related to #26938
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We currently translate the following LINQ query:
... to:
... when we could just translate to:
... since
COUNT(x)
only counts non-null values. This may have a perf impact (index usage).Related to #26938
The text was updated successfully, but these errors were encountered: