Reorganizing data in tablespaces | Utilities in database tier for WebSphere Commerce


DB2: Collecting statistics


+

Search Tips   |   Advanced Search

Each SQL statement submitted to the database is parsed, optimized, and a statement access plan is created for execution. To create this access plan, the optimizer relies on table and index statistics. In order for the optimizer to generate the best access plan, up-to-date statistics are required. Collecting statistics frequently (or at least when a significant amount of data changes) is a good practice.

To collect statistics for a table, the following command can be issued:

db2 RUNSTATS ON table . WITH DISTRIBUTION AND DETAILED INDEXES ALL;

Statistics on the catalog tables should also be collected.