Patent ID: 7127457

Claim:
A method for executing database queries including identifying redundant conditions, comprising the steps of: (a) identifying a first set of conditions corresponding to a selected step for executing a query; (b) identifying a second set of conditions corresponding to one or more steps for executing the query that feed the selected step; (c) for each condition in the first set, checking whether the condition is mathematically redundant, including redundant without being equivalent, with the conditions in a union of any other conditions corresponding to the selected step and the conditions in the second set, (d) including each condition in the first set that is redundant as checked in step (c) in a third set; (e) if there is only one condition in the third set after performing step (d), storing an identifier of the one condition; (f) calculating a cardinality of the selected step without considering any condition with a stored identifier; and (g) executing the query based at least in part on the cardinality to produce a query result.