Observation: Non-indexable LIKE Predicate
You coded a non-indexable LIKE predicate. Db2 will not use an index when you supply a wildcard character as the first character in a LIKE predicate. The DB2 optimizer can use a matching index scan when the leading characters of a search string are specified in the LIKE predicate.
Regardless of whether DB2 considers the LIKE predicate indexable, if the set of possible values is relatively small, consider recoding the LIKE predicate with either IN or BETWEEN, both of which are generally more efficient alternatives.
The example below includes a LIKE predicate to return all values of C1 that begin with "SAMP":
If C1 contains only five possible values, you could recode that statement using IN predicate, as shown below:
Similarly, if C1 can contain only a finite set of values, in this example, "01" through "99", you can recode the statement using BETWEEN predicate, as shown below: