摘要:
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 optimizing functions is described. A query including an invocation of a function is received. A function declaration indicates that the function is associated with a first set of datatypes. At compile-time, static type-checking is performed on the query. During the static type-checking, a second set of datatypes is determined for the function. The second set of datatypes includes the datatype of each argument of the function that is specified in the invocation. The query is compiled, where compiling the query includes compiling the function with the second set of datatypes.
摘要:
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.
摘要:
Constraints that restrict how corresponding identifiable groups of files are stored in a database, are enforced on corresponding file data. In response to a query on any data from an identifiable group of files, the effect of the constraint on how the corresponding data is stored is determined. The original query is rewritten, based on the effect of the constraint, so that the rewritten query is directed to a particular subset of the data stored in the database. Consequently, the search space is restricted to an identifiable subset of the database and execution of the rewritten query is more efficient than execution of the original query.
摘要:
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.
摘要:
Constraints that restrict how corresponding identifiable groups of files are stored in a database, are enforced on corresponding file data. In response to a query on any data from an identifiable group of files, the effect of the constraint on how the corresponding data is stored is determined. The original query is rewritten, based on the effect of the constraint, so that the rewritten query is directed to a particular subset of the data stored in the database. Consequently, the search space is restricted to an identifiable subset of the database and execution of the rewritten query is more efficient than execution of the original query.
摘要:
Techniques are provided for processing a query including receiving the query, where the query specifies certain operations; determining that the query includes a first portion in a first query language and a second portion in a second query language; generating a first in-memory representation for the first portion; generating a second in-memory representation for the second portion; generating a third in-memory representation of the query based on the first in-memory representation and the second in-memory representation; and performing the certain operations based on the third in-memory 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 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.
摘要:
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.