Page 1 of 1
Fetchrows versus Prefetchrows
Posted: Wed 08 Sep 2010 14:59
by heidenbluth
Could you please explain the difference between
TOraQuery.FetchRows and
TOraQuery.Options.Prefetchrows ?
The documentation doesn't tell much.
Which one has to be increased to speed up fetch performance?
Posted: Thu 09 Sep 2010 08:27
by AlexP
Hello,
TOraQuery.FetchRows sets the number of rows that will be transferred across the network at the same time. You should choose the optimal value of the FetchRows property for each SQL statement and software/hardware configuration experimentally.
TOraQuery.Options.Prefetchrows sets the number of rows that OCI prefetches when executing a query. Setting a value greater than 0 for this option minimizes server round trip count, that increases the application performance.
For example, if the Prefetchrows property is set to 0 and the FetchRows property is set to 25, then the number of requests to the server will be 4+1 for 100 records, but if Prefetchrows is set to 1, the number of requests will be 4. But some queries can return invalid rows count when prefetch is enabled.