DB2 Driver : Choosing a DB2 Optimization Class

Choosing a DB2 Optimization Class
By default, the driver requests the default optimization class. Most SQL statements are adequately optimized using the default optimization class, but you may want to use a different optimization class to improve performance. To specify an optimization class, set the CurrentQueryOptimization property.
In general, the lower optimization classes are better for simple or short-running SQL statements. The higher optimization classes consider more alternative query plans, which may benefit complex or long-running SQL statements, but they can incur significantly more compilation time, particularly if the SQL statement accesses multiple database tables. Benchmarks can help you determine if a better query plan has been generated for a SQL statement.
Consider the following general guidelines when choosing an optimization class:
*
*
*
*
Use a lower optimization class (0 or 1) for SQL statements that have short run times. These SQL statements often have the following characteristics:
*
*
*
*
*
Complex SQL statements may require different amounts of optimization to select the optimal query plan. Consider using higher optimization classes for SQL statements that have the following characteristics:
*
*
*
*
*
*
*

© 2012 Progress Software Corporation and/or its subsidiaries or affiliates.