Set up database statistics

Informix® provides a special instruction to compute database statistics in order to improve query optimization plans:

UPDATE STATISTICS [options]

IBM® DB2® provides the following equivalent:

RUNSTATS ON TABLE full-qualified-table-name [options]

Note: RUNSTATS is not a SQL instruction, it is a DB2 command and therefore cannot be executed from a BDL program.

Solution

You must execute the RUNSTATS command manually from a DB2 Command Center®.