Reoptimization for statements with replaced literal values

When literal values are replaced to concentrate dynamic SQL statements in the dynamic statement cache, Db2 uses the REOPT bind option to determine whether to use the literal values for access path selection.

Statement concentration can be enabled in one of the following ways:

Begin general-use programming interface information.
  • At the statement level, with the CONCENTRATE STATEMENTS WITH LITERALS attribute on a PREPARE statement
  • At the package level, with the CONCENTRATESTMT BIND PACKAGE or REBIND PACKAGE option
  • At the routine or advanced trigger level, with the CONCENTRATE STATEMENTS WITH LITERALS option
End general-use programming interface information.

Begin program-specific programming interface information.

When statement concentration is enabled, Db2 replaces literal values in the SQL statements with ampersand symbols (&). When this replacement occurs, Db2 uses the literal values in the statement for access path selection only when the REOPT(ONCE) or REOPT(AUTO) bind options are specified. When the default option REOPT(NONE) is specified, Db2 does not consider the literal values for access path selection.

End program-specific programming interface information.