So, I understand that SqlDataReader is pretty fast, you donโt know how many rows you will get, and it only allocates memory for each row at a time. So, if I have a million lines of small lines (say, 4 to 32 bytes), does each read line mean a return to the server? Doesn't buffering take place?
If I used ODBC through my own SQL client, I could set up a buffer buffer that was large enough to output 512 rows in each reverse direction. When the consumer reads row 0, I make a selection of 512 rows and then return row 0, the next 511 reads are memory accesses, and the 513rd read is new feedback.
For me it should be faster (and it wasnโt necessary to forward only), however it depends on how the result set is also implemented on the server. In the latter case, the result set must be completed before I can start receiving over the network, but it may not be so (?) For SqlDataReader and TDS, which I believe it uses, is a protocol that I am not familiar with. Any comments appreciated.
source share