Contents Index Consider collecting statistics on small tables Reduce expensive user-defined functions

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

Use user-estimates sparingly


Occasionally, statistics may become inaccurate. This condition is most likely to arise when only a few queries have been executed since a large amount of data was added, updated, or deleted. Inaccurate or unavailable statistics can impede performance. If Adaptive Server Anywhere is taking too long to update the statistics, try executing CREATE STATISTICS or DROP STATISTICS to refresh them. As well, in newer versions of the server (version 9.0 or later), Adaptive Server Anywhere will try to update statistics not only on LOAD TABLE and during query execution, but also on update DML statement.

In unusual circumstances, however, these measures may prove ineffective. If you know that a condition has a success rate that differs from the optimizer's estimate, you can explicitly supply a user estimate in the search condition.

Although user defined estimates can sometimes improve performance, avoid supplying explicit user-defined estimates in statements that are to be used on an ongoing basis. Should the data change, the explicit estimate may become inaccurate and may force the optimizer to select poor plans.

If you have used selectivity estimates that are inaccurate as a workaround to performance problems where the software-selected access plan was poor, you can set USER_ESTIMATES to OFF to ignore the values.


Contents Index Consider collecting statistics on small tables Reduce expensive user-defined functions