Contents Index Specify the correct cursor type Use user-estimates sparingly

ASA SQL User's Guide
  Monitoring and Improving Performance
    Top performance tips

Consider collecting statistics on small tables


Adaptive Server Anywhere uses statistical information to determine the most efficient strategy for executing each statement. Adaptive Server Anywhere automatically gathers and updates these statistics, and stores them permanently in the database. Statistics gathered while processing one statement are available when searching for efficient ways to execute subsequent statements.

To avoid collecting statistics when they may not be very useful, Adaptive Server Anywhere does not, by default, collect statistics on small tables. The definition of a small table is governed by the min_table_size_for_histogram database option, whose default value is 1000. Sometimes it is useful to collect statistics on a small table. In order to create statistics on a small table, use the CREATE STATISTICS statement. Once created, the statistics are automatically maintained by Adaptive Server Anywhere. It is also possible to get Adaptive Server Anywhere to automatically create statistics on all small tables by setting the option min_table_size_for_histogram to a smaller value. However, it is not necessary—and not recommended—to do so.


Contents Index Specify the correct cursor type Use user-estimates sparingly