Query Optimization by Specifying Path-Based Predicate Evaluation in a Path-Based Query Operator
First Claim
1. A method comprising:
- receiving a query against a collection of XML documents stored in one or more tables of a database, wherein the query contains a row filter condition;
determining that the query contains a set of path-based query operators that satisfy one or more criteria, wherein the set of path-based query operators comprises a first path-based query operator and a second path-based query operator;
wherein the one or more criteria includes;
a) the output from the first path-based query operator is the input to the second path-based operator;
b) the row filter condition contains a path-based operand that references the output from the second path-based query operator; and
c) the output from the second path-based query operator is not returned in the results for the query;
in response to determining that the set of path-based query operators meet the one or more criteria, rewriting the query by eliminating the second path-based query operator and re-writing the first path-based query operator to only return rows that satisfy the row filter condition;
wherein the method is performed by one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
The approaches described herein provide an efficient way for a database server to process certain kinds of queries over XML data stored in an object-relational database that require the evaluation of a predicate expression with one or more path-based operands. A predicate expression part of a XQuery or SQL WHERE clause that returns a boolean value. A database server first determines whether the query qualifies for this particular kind of optimization, then rewrites the query using an enhanced query operator syntax for specifying the predicate expression to be evaluated. The enhanced query operator subsumes the work of a second path-based query operator, resulting in the suppression of the WHERE EXISTS subquery. The rewritten query operator is used to generate a query execution plan that provides for several query execution optimizations.
-
Citations
9 Claims
-
1. A method comprising:
-
receiving a query against a collection of XML documents stored in one or more tables of a database, wherein the query contains a row filter condition; determining that the query contains a set of path-based query operators that satisfy one or more criteria, wherein the set of path-based query operators comprises a first path-based query operator and a second path-based query operator; wherein the one or more criteria includes; a) the output from the first path-based query operator is the input to the second path-based operator; b) the row filter condition contains a path-based operand that references the output from the second path-based query operator; and c) the output from the second path-based query operator is not returned in the results for the query; in response to determining that the set of path-based query operators meet the one or more criteria, rewriting the query by eliminating the second path-based query operator and re-writing the first path-based query operator to only return rows that satisfy the row filter condition; wherein the method is performed by one or more computing devices. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
Specification