Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
environments in particular, we strongly recommend the use of parameter markers in dynamic SQL to achieve superior performance. Note: Keeping table and index statistics up-to-date helps the DB2 optimizer choose the best access plan. However, unlike the case with static SQL, packages with dynamic SQL do not need to be rebound after new indexes have been added and/or new statistics have been gathered. But the package cache needs to be flushed via the FLUSH PACKAGE CACHE command to ensure that the new statistics are picked up. 3. For OLTP environments characterized by high concurrent activity, simple SQL statements and sub-second response time requirements, the optimization class should be set (SET CURRENT QUERY OPTIMIZATION statement) to a lower value such as 1 or 2. If the optimization level is not set in the CURRENT QUERY OPTIMIZATION special register, the DB2 optimizer will table the value set in the DFT_QUERYOPT database configuration parameter. Minimize the number of SQL statements issued Avoid using multiple SQL statements when the same request can be issued using one SQL statement. This minimizes the cost of accessing DB2, and also provides more information in an SQL statement, which enables the DB2