22. A computer program product comprising: receiving instructions to receive at least one SQL statement, wherein the at least one SQL statement is configured to operate on a first table and a second table, and the at least one SQL statement comprises an SQL statement that is configured to join the first table and the second table; generating instructions to automatically generate a set of SQL statements to query the first table and the second table, wherein the set of SQL statements are based, at least in part, upon the at least one SQL statement, the generating instructions are configured to use a relationship between the first table and the second table, and the set of SQL statements comprises SQL statements other than the at least one SQL statement; first producing instructions to produce a first result set by querying the first table using the set of SQL statements; second producing instructions to produce a second result set by querying the second table using the set of SQL statements, wherein the querying the first table and the querying second table are performed without joining the first table and the second table; joining instructions to join the first result set and the second result set to produce a third result set; returning instructions to return the third result set, in response to receiving the at least one SQL statement; and a computer-readable storage medium, wherein the computer program product is encoded in the computer-readable storage media.
29. The computer program product of claim 22 further comprising: obtaining instructions configured to obtain a search specification for the query of the first and second tables, wherein the set of SQL statements comprises a query statement to select a record from at least one of the first and second tables if the record satisfies the search specification, wherein the querying the first table executes the set of SQL statements against the first table to produce the first result set, and the querying the second table executes the second set of SQL statements against the second table to produce the second result set.