Method and system for executing database queries
AssigneeNCR Corporation
InventorAhmad Said Ghazal
Life of this patent
Estimating the term…
Abstract
A method, computer program, and computer network are disclosed for executing database queries. The method includes identifying a first set of conditions corresponding to a selected step for executing a query. A second set of conditions corresponding to one or more steps for executing the query that feed the selected step is identified. Each condition in the first set is checked for mathematical redundancy, including redundancy without equivalency, with regard to the other conditions in the union of the conditions corresponding to the selected step and the conditions in the second set. Each condition in the first set that is redundant is included in a third set. If there is only one condition in the third set, an identifier of the one condition is stored.
Claims27
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.
A computer program, stored on a tangible storage medium, for executing database queries, the program including executable instructions that cause a computer to:
- (a) identify a first set of conditions corresponding to a selected step for executing a query;
- (b) identify 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, check 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) include each condition in the first set that is redundant as checked in step (c) in a third set;
- and
- (e) if there is only one condition in the third set after performing step (d), store an identifier of the one condition;
- (f) calculate a cardinality of the selected step without considering any condition with a stored identifier;
- and
- (g) execute the query based at least in part on the cardinality to produce a query result.
A database system for executing database queries, comprising:
- one or more nodes;
- a plurality of CPUs, each of the one or more nodes providing access to one or more CPUs;
- a plurality of virtual processes, each of the one or more CPUs providing access to one or more virtual processes;
- each virtual process configured to manage data, including rows organized in tables, stored in one of a plurality of data-storage facilities;
- and
- an optimizer configured to:
- (a) identify a first set of conditions corresponding to a selected step for executing a query;
- (b) identify 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, check 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) include 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), store an identifier of the one condition;
- (f) calculate a cardinality of the selected step without considering any condition with a stored identifier;
- and
- (g) execute the query based at least in part on the cardinality to produce a query result.
Dependencies are inferred from the claim text.