If a large amount of data is being returned on a query, performance might be improved by increasing the size of the block of query data. How this is done depends on the types of servers participating in the query.
In an unlike environment, the size of the query block is determined at the application requester by a parameter sent with the Open Query command. When an iSeries™ server is the application requester (AR), it always initially requests a query block size of 32 KB. It increases the size of each successive requested query block for large queries that require multiple blocks to transmit. Other types of ARs give the user a choice of what block size to use. The default query block sizes for DB2® Universal Driver for SQLJ and JDBC, DB2 Universal Database™ for z/OS®, DB2 Universal Database™ for VM, and DB2 Universal Database for Linux®, UNIX® and Windows® are 32 KB, 32 KB, 8 KB, and 32 KB, respectively. See the product documentation for the platform being used as an AR when a DB2 Universal Database for iSeries server is connected to an unlike AR.
In the DB2 UDB for iSeries to DB2 UDB for iSeries environment, the query block size is determined by the size of the buffer used by the database manager. The default size is 4 KB. This can be changed on application servers that are at the version 2 release 3, or later. In order to do this, use the Submit Remote Command (SBMRMTCMD) command to send and execute an Override with Database File (OVRDBF) command on the application server (AS). Besides the name of the file being overridden, the (OVRDBF) command should contain OVRSCOPE(*JOB) and SEQONLY(*YES nnn). The number of records desired per block replaces nnn in the SEQONLY parameter. Increasing the size of the database buffer not only can reduce communications overhead, but can also reduce the number of calls to the database manager to retrieve the rows.
You can also change the query block size using an SQL CALL statement (a stored procedure) from non-iSeries servers or between iSeries servers.