dotnet / dotnet/efcore

Optimize reading a single value from the result set

Open
#29,842 2 comments 0 reactions 0 assignees View on GitHub
area-perf area-query
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

When the query is a `First` or `FirstOrDefault`, then we know that we will only ever read zero or one row from the reader. We might be able to make this more efficient. For example, [CommandBehavior.SingleRow](https://learn.microsoft.com/en-us/dotnet/api/system.data.commandbehavior?view=net-7.0) may help on some providers. In addition, we may be able to make the query execution delegate that we generate more efficient.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.