-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
At this time, as I select a large number of rows from the database (e.g. 1,000,000) at a single query, and process those rows on application side, what locks are taken by MySQL for the query are kept until the application is done processing.
This is due to the go-mysql driver not buffering result sets.
I suggest that this should be controllable; similarly to the C driver or the Connector/J driver, there should be a mysql_use_result/mysql_store_result config to control buffering. I suggest this is actually an important feature as, unfortunately, MySQL happens to put locks on seemingly innocent queries.
Having a buffered result set would only lock throughout the network time for results delivery; by the time the application gets to handle the result set, any locks will have already been cleared, and the application is free to waste clock time without impacting other database users.