You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: since DistinctBy returns the first element with a given key, it is order-sensitive, and so we should issue a warning if it's used without OrderBy.
Note that PostgreSQL has a DISTINCT ON feature which is likely much more efficient than what we generate above (npgsql/efcore.pg#894).
The text was updated successfully, but these errors were encountered:
@benmccallum yeah, just projecting first makes more sense to me: DistinctBy really is for when you want the actual entities, rather than just counting them afterwards.
.NET 6.0 introduced DistinctBy, which we could translate.
DistinctBy can be rewritten as follows:
Note: since DistinctBy returns the first element with a given key, it is order-sensitive, and so we should issue a warning if it's used without OrderBy.
Note that PostgreSQL has a
DISTINCT ON
feature which is likely much more efficient than what we generate above (npgsql/efcore.pg#894).The text was updated successfully, but these errors were encountered: