System and method for optimizing queries on views defined by conditional expressions having mutually exclusive conditions
First Claim
1. An information retrieval method for optimizing a query, comprising:
- evaluating the query to identify a view and a predicate referencing a column of the view;
wherein the view is derived from one or more base tables;
wherein the column comprises values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
wherein the condition predicates reference one or more base columns of the base tables;
wherein the predicate define a first range of the values of the column;
determining whether one of the condition predicates defines a mutually exclusive range of the values that comprises the first range of the values; and
rewriting the query to eliminate the condition predicates other than the one of the condition predicates and to apply the predicate directly to the base tables without evaluating the conditional expression.
1 Assignment
0 Petitions
Accused Products
Abstract
A query rewrite optimization method eliminates condition predicates of conditional expressions defining the values of a column that is referenced in the predicate of an SQL query on a view. The method evaluates the query to identify a view and a predicate referencing a column of the view. The column has values selected by a conditional expression having condition predicates defining respective mutually exclusive ranges of values. The predicate defines a first range of values. A determination is made as to whether one of the condition predicates defines a mutually exclusive range of values that comprises the first range of values. In response, the query is rewritten to eliminate the condition predicates other than the one condition predicate. The predicate is thus applied directly to the base tables without evaluating the conditional expression.
199 Citations
27 Claims
-
1. An information retrieval method for optimizing a query, comprising:
-
evaluating the query to identify a view and a predicate referencing a column of the view;
wherein the view is derived from one or more base tables;
wherein the column comprises values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
wherein the condition predicates reference one or more base columns of the base tables;
wherein the predicate define a first range of the values of the column;
determining whether one of the condition predicates defines a mutually exclusive range of the values that comprises the first range of the values; and
rewriting the query to eliminate the condition predicates other than the one of the condition predicates and to apply the predicate directly to the base tables without evaluating the conditional expression. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A query optimizer system for use in an information retrieval system that to optimize a query, the query optimizer system comprising:
-
a query evaluator for the query to;
(a) identify a view and a predicate referencing a column of the view;
wherein the view is derived from one or more base tables;
wherein the column comprise values selected by a conditional expression having condition predicates defining respective mutually exclusive ranges of the values;
wherein the condition predicates reference one or more base columns of the base tables; and
wherein the predicate define a first range of the values of the column; and
(b) determine whether one of the condition predicates defines a mutually exclusive range of the values that comprises the first range of the values; and
a query rewriter for the query to rewrite the query to eliminate the condition predicates other than the one of the condition predicates and to apply the predicate directly to the base tables without evaluating the conditional expression in response to the query evaluator. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A computer program product having instruction codes for directing an information retrieval system to optimize a query, the computer program product comprising:
-
a first set of instruction codes for evaluating the query to identify a view and a predicate referencing a column of the view;
wherein the view is derived from one or more base tables;
wherein the column comprises values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
wherein the condition predicates reference one or more base columns of the base tables; and
wherein the predicate defines a first range of the values of the column;
a second set of instruction codes for determining whether one of the condition predicates defines a mutually exclusive range of the values that comprises the first range of the values; and
a third set of instruction codes for rewriting the query to eliminate the condition predicates other than the one of the condition predicates and to apply the predicate directly to the base tables without evaluating the conditional expression. - View Dependent Claims (14, 15, 16, 17, 18)
-
-
19. An article for directing an information retrieval system to optimize a query, comprising:
-
means for evaluating the query to identify a view and a predicate referencing a column of the view;
wherein the view is derived from one or more base tables;
wherein the column comprises values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
wherein the condition predicates reference one or more base columns of the base tables; and
wherein the predicate defines a first range of the values of the column;
means for determining whether one of the condition predicates defines a mutually exclusive range of the values that comprises the first range of the values; and
means for rewriting the query to eliminate the condition predicates other than the one of the condition predicates and to apply the predicate directly to the base tables without evaluating the conditional expression. - View Dependent Claims (20, 21, 22, 23, 24)
-
-
25. An information retrieval method for optimizing a query, comprising:
-
evaluating the query to identify a view and a predicate that references a column of the view;
deriving the view from one or more base tables;
the column comprising values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
the condition predicates referencing one or more base columns of the base tables; and
the predicate defining a first range of the values of the column.
-
-
26. An information retrieval system for optimizing a query, comprising:
-
means for evaluating the query to identify a view and a predicate that reference a column of the view;
the view being derived from one or more base tables;
the column comprising values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
the condition predicates referencing one or more base columns of the base tables; and
the predicate defining a first range of the values of the column.
-
-
27. A computer program product having instruction codes for directing an information retrieval system to optimize a query, the computer program product comprising:
-
a first set of codes for evaluating the query. to identify a view and a predicate that reference a column of the view;
the view being derived from one or more base tables;
the column comprising values selected by a conditional expression having condition predicates that define respective mutually exclusive ranges of the values;
the condition predicates referencing one or more base columns of the base tables; and
the predicate defining a first range of the values of the column.
-
Specification