Using optimizer profiles
DB2 uses cost-based optimization for choosing the access plan for a query. The total cost depends on various factors, such as system configuration, database and database manager configuration, memory available (buffer pool, sort heap, and so on), current optimization level, CPU parallelism, IO characteristics, and so on, and most importantly information regarding the actual data. In the DB2 terminology, this is also known as catalog statistics. Therefore, it is always recommended to keep the statistics updated. These statistics include information about the following:
- Number of rows, data pages, active blocks, data range information, data length, and so on
- Most frequent values
- Number of distinct values for a column, and ...
Get IBM DB2 9.7 Advanced Application Developer Cookbook 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.