Previous Topic: Search StrategiesNext Topic: Boolean Term Predicate


Separate Predicates

We recommend that you use separate predicates for various numbers of key columns provided. This practice lets DB2 have matching index access for each combination of key parts provided.

First key access:

WHERE COL1 = WS-COL1

Two keys provided:

WHERE COL1 = WS-COL1
AND   COL2 = WS-COL2

Three keys provided:

WHERE COL1 = WS-COL1
AND   COL2 = WS-COL2

This practice increases the number of SQL statements that are coded within the program, but it also increases statement performance.