Patent ID: 8244715

Claim:
A system configured to process queries to a database, the system comprising: a database server comprising one or more processors configured to execute one or more computer program modules; and a memory storing a plurality of computer program modules comprising: a query reception module configured to receive a database query, wherein the query implicates a set of tables associated with the database that must be joined to satisfy the query; a subset module configured to divide the set of tables into a plurality of subsets of tables based on information describing relationships between tables in the set of tables, wherein at least two of the subsets of tables determined by the subset module comprise a common table and each of the two subsets comprises tables absent from the other subset; an intermediate join module configured to determine subset join orders that separately order the tables within the individual subsets of tables; a final join module configured to determine a final join order that orders the subset join orders, thereby ordering all of the tables in the set; and an optimizer module for generating an execution plan for the query, wherein the execution plan is generated responsive to determining the final join order that orders all of the tables in the set.