A method of rewriting a Structured Query Language (SQL) statement in order
to prevent processing of a join between a master table and a detail table
in a database is disclosed. The method includes determining in the SQL
statement a unique identifier to a row of the master table. The unique
identifier is then equated to an identifier to related rows of the detail
table using the join condition. A revised SQL statement may then be
produced that only refers to the detail table using the identifier to the
rows of the detail table. Subsequently, the revised SQL statement is
processed.