高铁能带打火机嘛:Optimizing Database Performance

来源:百度文库 编辑:偶看新闻 时间:2024/04/27 05:54:48

Optimizing Database Performance

The goal of performance tuning is to minimize the responsetime for each query.

One of the ways to accelerate transactions is minimizingexpensive network traffic between the server and client. It can beuseful when working with recordsets with a great number of rows.

SQLAPI++ Library provides support for bulk row fetching,which means that multiple records can be retrieved at once during asingle fetch, rather than retrieving one record at a time from the datasource. To set bulk row fetching you should set PreFetchRows command optionbefore the command execution. It is safe to use PreFetchRowsoption in any DBMS. If DBMS does not support bulk row fetching thenthis option will be ignored.

The value of PreFetchRows option specifieshow many rows you wish to retrieve during a single fetch when usingbulk row fetching. The default value is "1"; it means that you are notusing bulk row fetching.

See Example tocompare time expended on fetching rows with and without bulk mode.

Problems and Questions

If you haven't found the answer to your questions or have someproblems on using the Library, please, send e-mail to howto@sqlapi.com.