See https://github.com/dotnet/efcore/blob/main/src/EFCore/Query/Internal/QueryOptimizingExpressionVisitor.cs#L159