skip to main content
Connection Property Descriptions : FetchSize
  

Try DataDirect Drivers Now

FetchSize

Purpose

Specifies the number of rows that the driver processes before returning data to the application when executing a Select. This value provides a suggestion to the driver as to the number of rows it should internally process before returning control to the application. The driver may fetch fewer rows to conserve memory when processing exceptionally wide rows.

Valid Values

0 | x
where:
x
is a positive integer indicating the number of rows that should be processed.

Behavior

If set to 0, the driver fetches and processes all of the rows of the result before returning control to the application. When large data sets are being processed, setting FetchSize to 0 can diminish performance and increase the likelihood of out-of-memory errors.
If set to x, the driver limits the number of rows that may be processed for each fetch request before returning control to the application.

Notes

*To optimize throughput and conserve memory, the driver uses an internal algorithm to determine how many rows should be processed based on the width of rows in the result set. Therefore, the driver may process fewer rows than specified by FetchSize when the result set contains exceptionally wide rows. Alternatively, the driver processes the number of rows specified by FetchSize when the result set contains rows of unexceptional width.
*FetchSize can be used to adjust the trade-off between throughput and response time. Smaller fetch sizes can improve the initial response time of the query. Larger fetch sizes can improve overall response times at the cost of additional memory.
*You can use FetchSize to reduce demands on memory and decrease the likelihood of out-of-memory errors. Simply, decrease FetchSize to reduce the number of rows the driver is required to process before returning data to the application.
*The ResultMemorySize connection property can also be used to reduce demands on memory and decrease the likelihood of out-of-memory errors.

Default

100 (rows)

Data Type

Int

See also

*Using Connection Properties
*Performance Considerations
*ResultMemorySize
*Troubleshooting Out-of-Memory Errors