An improved mechanism for processing a multiple table query includes:
determining if any tables in the query require materialization; for each
table in the query that requires materialization, deriving at least one
join predicate on a join column; determining if any tables earlier in a
join sequence for the query has same join predicates; and applying the at
least one derived join predicate to an earlier table in the join
sequence, if there is at least one table earlier in the join sequence
that has the same join predicate. This significantly reduces the number
of rows that are joined before arriving at the final result.