Techniques of XML query optimization over static and dynamic heterogeneous XML containers
First Claim
Patent Images
1. A method comprising the steps of:
- receiving a database statement that targets a table that contains a plurality of XML documents, wherein at least two of the XML documents in the table do not conform to the same XML schema;
wherein the table comprises (a) a plurality of rows that each stores data for a different XML document and (b) a column that indicates, for each row, the schema to which the corresponding XML document conforms;
in response to receiving the database statement, generating a plurality of execution plans for said database statement;
wherein each execution plan of said plurality of execution plans corresponds to a different XML schema;
wherein each execution plan of the plurality of execution plans is optimized based on the XML schema to which said execution plan corresponds;
producing a plurality of intermediate results by using each execution plan, of the plurality of execution plans, to execute the database statement relative to only those XML documents, within the table, that conform to the XML schema associated with the execution plan;
wherein using said each execution plan to execute the database statement includes, for each row of two or more rows of the table, using one or more values from the column of the table to determine the XML schema to which the corresponding XML document conforms; and
generating a final result for the database statement based on the plurality of intermediate results;
wherein the steps are performed on one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus for optimizing XML queries over heterogeneous XML tables is provided. A query that targets a container (e.g. table or collection) that contains a plurality of XML documents is received, wherein at least two XML documents in the plurality do not conform to the same schema. Based on the received query, a plurality of execution plans is generated. Each execution plan is associated with a different XML schema. An execution plan is used to execute the query relative to those XML documents that conform to the XML schema associated with the execution plan.
46 Citations
44 Claims
-
1. A method comprising the steps of:
-
receiving a database statement that targets a table that contains a plurality of XML documents, wherein at least two of the XML documents in the table do not conform to the same XML schema; wherein the table comprises (a) a plurality of rows that each stores data for a different XML document and (b) a column that indicates, for each row, the schema to which the corresponding XML document conforms; in response to receiving the database statement, generating a plurality of execution plans for said database statement; wherein each execution plan of said plurality of execution plans corresponds to a different XML schema; wherein each execution plan of the plurality of execution plans is optimized based on the XML schema to which said execution plan corresponds; producing a plurality of intermediate results by using each execution plan, of the plurality of execution plans, to execute the database statement relative to only those XML documents, within the table, that conform to the XML schema associated with the execution plan; wherein using said each execution plan to execute the database statement includes, for each row of two or more rows of the table, using one or more values from the column of the table to determine the XML schema to which the corresponding XML document conforms; and generating a final result for the database statement based on the plurality of intermediate results; wherein the steps are performed on one or more computing devices. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
-
37. A method comprising the steps of:
-
receiving a database statement that targets a container that contains a plurality of XML documents, wherein at least two of the XML documents in the container do not conform to the same XML schema; in response to receiving the database statement, generating a plurality of execution plans for said database statement; wherein each execution plan of said plurality of execution plans corresponds to a different XML schema; wherein each execution plan of the plurality of execution plans is optimized based on the XML schema to which said execution plan corresponds; producing a plurality of intermediate results by using each execution plan, of the plurality of execution plans, to execute the database statement relative to those XML documents, within the container, that conform to the XML schema associated with the execution plan; generating a final result for the database statement based on the plurality of intermediate results; and maintaining a set of statistics that indicate, for each schema in a plurality of schemas, a number of XML documents in the plurality of XML documents that conform to said each schema; wherein the set of statistics are generated by performing one or more of the following; (a) executing a query against the container to determine the number of XML documents in the plurality of XML documents that conform to said each schema, or (b) for each schema of the plurality of schemas, incrementing a count that corresponds to said each schema when a new XML document that conforms to said each schema is added to the container and decrementing said count when an XML document, of the plurality of documents, that conforms to said each schema is deleted from the container; wherein the steps are performed on one or more computing devices. - View Dependent Claims (38, 39, 40, 41, 42, 43, 44)
-
Specification