Patent ID: 7962476

Claim:
An apparatus for executing a database query that comprises an inner join and returns rows with fields F, subject to a set of restrictions R, said apparatus comprising: means for instantiating exactly one Query Execution Node (QEN) associated with each table participating in said query; means for connecting, with a computer, the QENs to each other in a chain; for each QEN in said chain, means for requesting rows from the previous QEN in said chain, if present; means for performing a single-table query against the associated table using said requested rows, if present; and means for passing the resulting rows from said single-table query to the next QEN in said chain; and means for outputting, with said computer, a solution to said query that comprises the rows that are returned by the last QEN in said chain; wherein a single-table query against a table t comprises three arguments I, R q , and F p , where: I is a set of input rows comprising said requested rows, if present; R q is the set of restrictions within R that operate on the fields indicated by F I ∪F t , where F I and F t are the sets of field names from I and t, respectively; and F p is a set of field names from F I ∪F t indicating the columns onto which results should be projected to yield said resulting rows; wherein in response to a request for said requested rows, the i th QEN in said chain performs a single-table query against the associated table t i with arguments I, R q and F p equal to I i−1 , R i , and F i respectively, where R I is the set of restrictions containing all restrictions that can be applied using only fields from t I , and F I is the set of fields that either exist in F or in one of the remaining unused restrictions in R; and wherein in response to a request for a said requested rows, the ith QEN in said chain performs a single-table query against the associated table t i with arguments I, R q , and F p equal to I i−1 , R i , and F i , respectively, where I i−1 is said requested rows received from said previous QEN in said chain, R i is the set of restrictions that have not been associated with a previous QEN in said chain and can be applied using only fields from table t i and F i−1 , and F i is the set of fields that either exist in F or in one of the remaining unused restrictions in R.