| FetchAhead enables a feature that allows SQLServices to fetch more than
1 row per network packet. It essentially tells the driver to use
SQL_FETCH_MANY calls instead of individual fetches.
This is the same functionality as the ODBC SQLExtendedFetch call. Many
front end applications do not use the more efficiant SQLExtendedFetch
call so FetchAhead is a way to override that to improve performance.
There are a couple cases where you would not want fetchahead enabled. The
first is if the application has more than 1 statement active on a
connection at a time. For example, if an app is fetching from a
previously prepared statement and tries to prepare/execute another
select statement on the same connection while the original is still
active. In this case, the driver returns a pretty descriptive error
indicating this (something like can't do this with fetchahead enabled).
Another would be if your network was flaky. I have seen occurances of
weird packet problems that go away when FetchAhead is disabled.
In any case, this feature can dramaticly improve performance and I
would only turn it off if necessary.
John
|