Request: result buffering in ResultSet

Issue #14 resolved
Former user created an issue

While debugging some perfomance issues in dbmail I narrowed it down to the slow walk thru ResultSet_next, which basically translates to mysql_stmt_fetch(). Documentation for it says that "By default, result sets are fetched unbuffered a row at a time from the server". What I'm observing is a case where query takes 0.05s, returns about 7k rows and then walking thru the ResultSet takes over 15s.

I assume that implementing mysql_stmt_store_result() and necessary memory management would speed this up significantly.

I don't know if other db implementations have similar issue.

Comments (2)

  1. Tildeslash repo owner

    The reason we use mysql_stmt_fetch instead of mysql_stmt_store_result is to keep memory usage low. However, it could be interesting to see how much speedup you would gain by storing the result set client-side. If you want to test, I believe you could simply call mysql_stmt_store_result in MysqlResultSet_new after the for-loop doing bind and after adding mysql_stmt_bind_result. If you do test, please let me know the result and also how much the memory usage increased.

  2. Log in to comment