Maintain a Current UPDATE STATISTICS

The operations of the OnLine optimizer depend upon the data that is collected from runs of the SQL UPDATE STATISTICS command. This command looks at the distribution of data in the tables and indexes and stores it internally. Based upon this information, the optimizer decides the best way to execute your SQL statements. If the statistics information is stale or nonexistent, you could get SQL statements that perform poorly.

Get your users and developers into the habit of running an UPDATE STATISTICS FOR TABLE tablename every time they create a new table, create a new index, or significantly modify the distribution of data within a table. If you already have your users trained in the use of the SET EXPLAIN ON ...

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.