Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

JDBCドライバがサーバとの1回の通信で取得する行数のデフォルト値

  • Oracle 11.2は10行。*1

    By default, when Oracle JDBC runs a query, it retrieves a result set of 10 rows at a time from the database cursor. This is the default Oracle row fetch size value.

  • Oracle 21は10行。*2

    By default, when Oracle JDBC runs a query, it retrieves a result set of 10 rows at a time from the database cursor. This is the default Oracle row fetch size value.

  • PostgreSQLは全行を一気に取得する。*3

    By default the driver collects all the results for the query at once.

  • MySQL Connector/J 8.0は全行を一気に取得する。*4

    By default, ResultSets are completely retrieved and stored in memory. In most cases this is the most efficient way to operate and, due to the design of the MySQL network protocol, is easier to implement. If you are working with ResultSets that have a large number of rows or large values and cannot allocate heap space in your JVM for the memory required, you can tell the driver to stream the results back one row at a time.

  • HiRDB 09-50以前は1行。HiRDB 09-50以降は10キロバイトぶん。*5

    バージョン09-50で、ブロック転送機能はデフォルトで有効となります。ユーザがブロック転送機能の指定を何もしない場合、PDBLKBUFFSIZEの省略値が10キロバイトとなります。

  • Microsoft JDBC Driver for SQL Server 1.2までは全行を一気に取得する。Microsoft JDBC Driver for SQL Server 2.0以降は"adaptive"に取得する。*6

    Starting with the JDBC driver version 2.0, the default behavior of the driver is "adaptive". In other words, in order to get the adaptive buffering behavior, your application does not have to request the adaptive behavior explicitly. In the version 1.2 release, however, the buffering mode was "full" by default and the application had to request the adaptive buffering mode explicitly.