Observation: Column and Literal Length Mismatch

You coded a query that compares a column to a literal. If the literal is longer than the column, the Db2 optimizer may not use an index on the predicate.

In the following example, lastname is defined as char(12), and is compared to a 14 character literal.

SELECT lastname, firstname 

FROM T1 
WHERE lastname = ' Williamshire'; 

Consider recoding the query using a literal of a length equal or less than the defined size of the column.