mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Prepared statements: fetching a limited number of rows

Open anarthal opened this issue 5 years ago • 1 comments

When issuing a text query, the server immediately sends all rows to the client. This is not avoidable. However, there is a mechanism in the protocol to prevent this in binary resultsets. Make use of this feature so the user can decide whether to fetch immediately all the rows or fetch them progressively.

anarthal avatar Nov 29 '20 17:11 anarthal

When implementing this, it is important to provide performance benchmarks in the docs, comparing this cursor approach vs. the "read everything in one go" approach. Suggested:

  • Time to first row
  • Overall time to consume the entire resultset
  • Time elapsed if resultset should be discarded before being complete

anarthal avatar May 19 '22 09:05 anarthal