DB2 10 - Introduction - Block fetch


Volta a página anterior

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

DB2 10 - Introduction - Block fetch

You can use block fetch to retrieve a set of rows and transmit them all in one message over the network.

DB2® uses a block fetch to group the rows that an SQL query retrieves into as large a "block" of rows as can fit in a message buffer, and then transmits the block over the network.
By sending multiple rows in a block, DB2 avoids sending a message for every row.

A block fetch is used only with cursors that do not update data.
The size of a DRDA® query block on z/OS® is limited to 32 KB.

DB2 can use two different types of block fetch:

Limited block fetch
An operation that optimizes data transfer by guaranteeing the transfer of a minimum amount of data in response to each request from the requesting system.
Continuous block fetch
An operation that sends a single request from the requester to the server.
The server fills a buffer with data that it retrieves and transmits it back to the requester.
Processing at the requester is asynchronous with the server; the server continues to send blocks of data to the requester with minimal or no further prompting.

To use block fetch, DB2 must determine that the cursor is not used for update or delete.
You can indicate in your program by adding the clause FOR READ ONLY to the query.
If you do not specify FOR READ ONLY, DB2 use of block fetch depends on how you define the cursor.

For scrollable cursors, the sensitivity of the cursor and the bind option affect whether you can use block fetching.



© Copyright IBM Corp.