Does FirstOrDefaultAsync
Pull The Entire ResultSet Into Memory?
#2093
Replies: 1 comment 3 replies
-
@Mike-E-angelo In older versions of Rx I did observe a difference between Not sure if this is still there in the newer versions, but you might want to try adding |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am making use of
FirstOrDefaultAsync
on EFCore queries and I was noticing that one of the calls I am using this on is taking 16 seconds to complete. Upon closer inspection, the query generated by EFCore takes about 16 seconds to complete without aTOP(1)
(or other filter) applied to it.This has me worried. I poked into the code for
FirstOrDefaultAsync
and it seems that only the first row is pulled from theIAsyncEnumerable
but I wanted to be sure this is operating as expected.Can someone please confirm my understanding that only one row is pulled from the database when this call is made, and not the entire dataset?
Thank you for any assistance you can provide.
Beta Was this translation helpful? Give feedback.
All reactions