MySQL Connector, Streaming Resultsets and Batch Fetching

家住魔仙堡 提交于 2019-12-11 02:26:15

问题


I was browsing through the MySQL Connector (5.1.24) source code and I noticed something unusual in the method StatementImpl#createStreamingResultSet

The javadoc says

We only stream result sets when they are forward-only, read-only, and the fetch size has been set to Integer.MIN_VALUE

@return true if this result set should be streamed row at-a-time, rather than read all at once.

This makes me believe that if we want to stream result sets in MySQL, then there is no option of retrieving rows in batches (say 100 at a time).

Is the assumption true that if the fetch-size is Integer.MIN_VALUE, then the results will be retrieved 1 row at a time? And wouldn't that be a performance hit?

来源:https://stackoverflow.com/questions/16029611/mysql-connector-streaming-resultsets-and-batch-fetching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!