Techniques for efficient integration of text searching with queries over XML data
First Claim
1. A machine-implemented method, comprising the steps of:
- storing, within one or more structures of a database, data for an XML document;
receiving a database command with an embedded XML query expression, wherein the embedded XML query expression specifies (a) a path that identifies one or more locations within the structure of the XML document, and (b) text search criteria for filtering the one or more locations based on content contained within the one or more locations;
determining whether an index should be used as a primary filter;
upon determination that a set of conditions is satisfied, transforming, within the database command, the embedded XML query expression into a rewritten expression that includes a text function, wherein the text function specifies the path and the text search criteria, and wherein the text function includes a reference to the index if it was determined that the index should be used; and
executing the database command to retrieve data from the one or more structures based on the path and the text search criteria specified in the rewritten expression.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus for rewriting a database command containing an embedded XML expression such that the rewritten database command recites a text function, in lieu of the embedded XML expression, is provided. Advantageously, a DBMS may take advantage of the efficiencies in storing XML data within the database, while avoiding the generation of unnecessary XML elements in processing the query when the XML elements contribute nothing to the outcome of the query. Cost-base or rule-based analysis may be performed to determine how to rewrite a received database command. The database server may functionally evaluate the text function or may use an index defined on a column of the database. The text function may function as a primary filter or may reference a column upon which an index is defined, wherein the index operates at the same or higher level than a column being referenced in the embedded XML expression.
-
Citations
28 Claims
-
1. A machine-implemented method, comprising the steps of:
-
storing, within one or more structures of a database, data for an XML document; receiving a database command with an embedded XML query expression, wherein the embedded XML query expression specifies (a) a path that identifies one or more locations within the structure of the XML document, and (b) text search criteria for filtering the one or more locations based on content contained within the one or more locations; determining whether an index should be used as a primary filter; upon determination that a set of conditions is satisfied, transforming, within the database command, the embedded XML query expression into a rewritten expression that includes a text function, wherein the text function specifies the path and the text search criteria, and wherein the text function includes a reference to the index if it was determined that the index should be used; and executing the database command to retrieve data from the one or more structures based on the path and the text search criteria specified in the rewritten expression. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A machine-implemented method, comprising the steps of:
-
storing, within one or more structures of a database, data for an XML document; receiving a database command with an embedded XML query expression, wherein the embedded XML query expression specifies (a) a path that identifies one or more locations within the structure of the XML document, and (b) search criteria for filtering the one or more locations based on content contained within the one or more locations; upon determination that a set of conditions is satisfied, rewriting the database command to additionally recite a database function, wherein, upon executing the database command, the database function acts as a primary filter; executing a first portion of the database command to retrieve, from the one or more structures, a first data set, wherein the first portion includes the database function; and executing a second portion of the database command, against the first data set, to identify data within the first data set that satisfies the search criteria specified in the embedded XML query expression, wherein the second portion includes the embedded XML query expression. - View Dependent Claims (11, 12, 13, 14)
-
-
15. A machine-readable medium carrying one or more sequences of instructions, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
storing, within one or more structures of a database, data for an XML document; receiving a database command with an embedded XML query expression, wherein the embedded XML query expression specifies (a) a path that identifies one or more locations within the structure of the XML document, and (b) text search criteria for filtering the one or more locations based on content contained within the one or more locations; determining whether an index should be used as a primary filter; upon determination that a set of conditions is satisfied, transforming, within the database command, the embedded XML query expression into a rewritten expression that includes a text function, wherein the text function specifies the path and the text search criteria, and wherein the text function includes a reference to the index if it was determined that the index should be used; and executing the database command to retrieve data from the one or more structures based on the path and the text search criteria specified in the rewritten expression. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23)
-
-
24. A machine-readable medium carrying one or more sequences of instructions, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
storing, within one or more structures of a database, data for an XML document; receiving a database command with an embedded XML query expression, wherein the embedded XML query expression specifies (a) a path that identifies one or more locations within the structure of the XML document, and (b) search criteria for filtering the one or more locations based on content contained within the one or more locations; upon determination that a set of conditions is satisfied, rewriting the database command to additionally recite a database function, wherein, upon executing the database command, the database function acts as a primary filter; executing a first portion of the database command to retrieve, from the one or more structures, a first data set, wherein the first portion includes the database function; and executing a second portion of the database command, against the first data set, to identify data within the first data set that satisfies the search criteria specified in the embedded XML query expression, wherein the second portion includes the embedded XML query expression. - View Dependent Claims (25, 26, 27, 28)
-
Specification