Fetchrows versus Prefetchrows

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heidenbluth
Posts: 56
Joined: Mon 08 Nov 2004 19:01
Location: Germany

Fetchrows versus Prefetchrows

Post by heidenbluth » Wed 08 Sep 2010 14:59

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?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 09 Sep 2010 08:27

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.

Post Reply