Observation: Join without Criteria

If you do not specify join criteria using either a WHERE clause or a JOIN clause, DB2 matches rows from one table with every row in the joined table. This results in a Cartesian product where the total number of rows in the result set equals the number of rows in the inner table multiplied by the number of rows in the outer table. The result set of multiple, large tables joined without a criteria can be enormous, and will severely impact performance.

Generally, the number of rows joined influences performance more than the number of tables joined. Therefore, add the appropriate criteria to reduce the result set and, to maximize the probability of the Db2 optimizer using an index, ensure that the join columns have matching data types and lengths.