Observation: Multiple Columns from the Same Table

You coded a query using two columns from the same table as predicates. When a query uses two columns from the same table, the Db2 optimizer may not consider access through available indexes for these columns.

In the following example, the Db2 optimizer may not consider indexes on column C1 or C2.

SELECT * FROM T1 
WHERE C1 = C2; 

Consider recoding the query using correlated names. The DB2 optimizer will process the table as two separate tables, and may consider using indexes on the columns.

SELECT * FROM T1 A, 
T1 B 
WHERE A.C1 = B.C2;