摘要:
XML table indexes provide a more efficient mechanism for searching data stored in aggregate form. XML table indexes are a set of tables created to project out in column form commonly sought metadata from stored XML documents. By projecting the data includes into column form, queries on the XML documents can be efficiently processed as they can leverage the enhanced functionality provided by the database tables. The XML table indexes may use aliases, partitioning, constraints and other functions to further improve query flexibility and performance.
摘要:
A method for processing queries is provided. A first representation of a query is generated, where the query includes a certain operator that is to be performed based on an XPath expression that is expandable into multiple location paths. The first representation of the query is rewritten into a second representation that corresponds to an equivalent query, where rewriting the first representation includes expanding the XPath expression into the plurality of location paths and, based on the certain operator, including a plurality of operators in the second representation, where the plurality of operators include: a first set of operators that is to be performed based on each of the plurality of location paths, and a second set of operators that is to be performed based on data returned from at least one operator included in the first set of operators. The query may thereafter be executed based on the second representation. The second representation may be further rewritten to third representation depending on the physical storage of XML.
摘要:
A method for optimizing queries is described. A query, which includes a first expression for determining whether each of a set of values evaluates to NULL or NOT NULL, is received. At compile-time, a first representation of the query is generated, where the first representation indicates that the query is to be performed based on the first expression. Based on the first expression, a second expression is determined. The second expression is such that the first expression would evaluate to any NOT NULL value if and only if the second expression would evaluate to any NOT NULL value. The second expression, when evaluated, is much more computationally efficient compared with the evaluation of the first expression. Based on the first representation, a second representation of the query is generated, where the second representation indicates that the query is to be performed based on the second expression. Thereafter, the query is executed based on the second representation.
摘要:
A method for optimizing queries is described. A query, which includes a first expression for determining whether each of a set of values evaluates to NULL or NOT NULL, is received. At compile-time, a first representation of the query is generated, where the first representation indicates that the query is to be performed based on the first expression. Based on the first expression, a second expression is determined. The second expression is such that the first expression would evaluate to any NOT NULL value if and only if the second expression would evaluate to any NOT NULL value. The second expression, when evaluated, is much more computationally efficient compared with the evaluation of the first expression. Based on the first representation, a second representation of the query is generated, where the second representation indicates that the query is to be performed based on the second expression. Thereafter, the query is executed based on the second representation.
摘要:
A mechanism is provided for accessing XML data in a database system using a combination of a XML Table Index table and a XML Path Index table. By using a combination of a XML Table Index and a XML Path Index, both selection access and navigational access involved in a query can be optimized. For example, the XML Table Index gives the database system an ability to readily evaluate the predicate expression, thereby improving the selection access. Moreover, in some embodiments, the selection access can be further improved by using secondary indexes on columns contained in the XML Table Index table. In a complementary manner, the XML Path Index table gives the database system an ability to navigate to a specific location given a path expression, thereby improving the navigational access. Thus, by combining both tables, both selection and navigational accesses are improved.
摘要:
A method for processing queries is provided. A first representation of a query is generated, where the query includes a certain operator that is to be performed based on an XPath expression that is expandable into multiple location paths. The first representation of the query is rewritten into a second representation that corresponds to an equivalent query, where rewriting the first representation includes expanding the XPath expression into the plurality of location paths and, based on the certain operator, including a plurality of operators in the second representation, where the plurality of operators include: a first set of operators that is to be performed based on each of the plurality of location paths, and a second set of operators that is to be performed based on data returned from at least one operator included in the first set of operators. The query may thereafter be executed based on the second representation. The second representation may be further rewritten to third representation depending on the physical storage of XML.
摘要:
Commonly searched nodes of complex data types contained in a collection of XML documents can be projected to, and their values can be stored in, corresponding columns in XML Table Index tables in a database system. In one embodiment, those columns stores logical pointers, rather than raw values, of the complex data types. Domain indexes are further provided to index at least one of the columns of complex data types in XML Table Indexes. The inclusion of complex data types and domain indexes provide a more efficient mechanism for searching domain specific data, such as audio, video, text stored in the collection of XML documents. Query optimizer logic of the database system can prepare one or more query execution plans for a submitted query including a plan that leverages XML Table Indexes and domain indexes and select a query execution plan based on cost information.
摘要:
Commonly searched nodes of complex data types contained in a collection of XML documents can be projected to, and their values can be stored in, corresponding columns in XML Table Index tables in a database system. In one embodiment, those columns stores logical pointers, rather than raw values, of the complex data types. Domain indexes are further provided to index at least one of the columns of complex data types in XML Table Indexes. The inclusion of complex data types and domain indexes provide a more efficient mechanism for searching domain specific data, such as audio, video, text stored in the collection of XML documents. Query optimizer logic of the database system can prepare one or more query execution plans for a submitted query including a plan that leverages XML Table Indexes and domain indexes and select a query execution plan based on cost information.
摘要:
A mechanism is provided for accessing XML data in a database system using a combination of a XML Table Index table and a XML Path Index table. By using a combination of a XML Table Index and a XML Path Index, both selection access and navigational access involved in a query can be optimized. For example, the XML Table Index gives the database system an ability to readily evaluate the predicate expression, thereby improving the selection access. Moreover, in some embodiments, the selection access can be further improved by using secondary indexes on columns contained in the XML Table Index table. In a complementary manner, the XML Path Index table gives the database system an ability to navigate to a specific location given a path expression, thereby improving the navigational access. Thus, by combining both tables, both selection and navigational accesses are improved.
摘要:
Techniques are provided for determining whether an XML table index may be used when executing an XML query. An XML table index is defined with a row pattern expression and one or more column pattern expressions. In one technique, an index expression is generated for each row pattern expression-column pattern expression combination. An expression included in the XML query (“query expression”) is compared against one or more of the index expressions. In another technique, even if a query expression does not exactly match a row pattern expression, it is determined whether the query expression is equivalent to the row pattern expression. In another technique, even if a query expression does not exactly match and a row pattern expression, it is determined whether the query expression is “contained by” the row pattern expression.