Skip to content

Question : Does ExecuteReaderAsync() load result set progressively? #1025

Answered by bgrainger
wangjia184 asked this question in Q&A
Discussion options

You must be logged in to vote

The method returns as soon as the MySQL Server sends the "result set header" (which includes the list of columns included in the results) and before any rows have been read from the network. Rows are only read from the network connection when you call ReadAsync and NextResultAsync; it's not all read ahead of time and buffered in memory.

The other variable here is whether the MySQL Server "streams" the data to the client, or whether it first computes the whole million-row result set in memory and then writes it to the client. If the latter, it can seem like ExecuteReaderAsync "waits" until all the rows are available, but it's just dependent on when MySQL Server actually sends the data.

(An…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bgrainger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1024 on August 21, 2021 16:13.