摘要:
A method and apparatus for automatically analyzing and providing feedback regarding the optimizability of a relational database query. A query developer's primary goal is to ensure that queries and DML operations are rewritten for the most efficient execution. Rewrite diagnosability captures metadata for each attempted query optimization including success or failure and the reasons for failure. The metadata is stored in association with the operators that were not removed through rewriting. Once all optimizations have been attempted and rewriting is complete, the metadata is selectively displayed based on the cost to perform the associated operation. The context of performing the operation may affect the cost. The cost may be based at least on the type of operation and where within the query tree the operation is located. A query developer may configure the database system not to execute the resulting query plan based on one or more criteria.
摘要:
A method and apparatus for automatically analyzing and providing feedback regarding the optimizability of a relational database query. A query developer's primary goal is to ensure that queries and DML operations are rewritten for the most efficient execution. Rewrite diagnosability captures metadata for each attempted query optimization including success or failure and the reasons for failure. The metadata is stored in association with the operators that were not removed through rewriting. Once all optimizations have been attempted and rewriting is complete, the metadata is selectively displayed based on the cost to perform the associated operation. The context of performing the operation may affect the cost. The cost may be based at least on the type of operation and where within the query tree the operation is located. A query developer may configure the database system not to execute the resulting query plan based on one or more criteria.
摘要:
Techniques and approaches are provided for creating indexes and column constraints on structured XML data that is stored in a relational database. Data Definition Language (DDL) Create Index and Create Constraint commands have extended syntax that allows the specification of a path-based expression instead of requiring a column and table name. A mapping created by the system when an XML Schema is registered stores the correspondence of XML data elements to automatically-created database tables and columns that are given names only useful for the internal system. When a user provides a path-based expression in a DDL when creating an index or constraint, the path-based expression is translated to the underlying database constructs using the mapping. Issues are addressed for handling path-based expressions that evaluate to more than one element. Additional index optimization is described using data type information available in the XML schema to select the optimal index type.
摘要:
Techniques and approaches are provided for creating indexes and column constraints on structured XML data that is stored in a relational database. Data Definition Language (DDL) Create Index and Create Constraint commands have extended syntax that allows the specification of a path-based expression instead of requiring a column and table name. A mapping created by the system when an XML Schema is registered stores the correspondence of XML data elements to automatically-created database tables and columns that are given names only useful for the internal system. When a user provides a path-based expression in a DDL when creating an index or constraint, the path-based expression is translated to the underlying database constructs using the mapping. Issues are addressed for handling path-based expressions that evaluate to more than one element. Additional index optimization is described using data type information available in the XML schema to select the optimal index type.
摘要:
A method and apparatus are provided for building and using a persistent XML tree index for navigating an XML document. The XML tree index is stored separately from the XML document content, and thus is able to optimize performance through the use of fixed-sized index entries. The XML document hierarchy need not be constructed in volatile memory, so creating and using the XML tree index scales even for large documents. To evaluate a path expression including descendent or ancestral syntax, navigation links can be read from persistent storage and used directly to find the nodes specified in the path expression. The use of an abstract navigational interface allows applications to be written that are independent of the storage implementation of the index and the content. Thus, the XML tree index can index documents stored at least in a database, a persistent file system, or as a sequence of in memory.
摘要:
Techniques are provided for searching within a collection of XML documents. A relational table in an XML index stores an entry for each node of a set of nodes in the collection. Each entry of the relational table stores an order key and a path identifier along with the atomized value of the node. An index on the atomized value provides a mechanism to perform a node-aware full-text search. Instead of storing the atomized value in the table, a virtual column may be created to represent, for each node, the atomized value of the node. Alternately, each entry of the relational table stores an order key and a path identifier along with, for simple nodes, the atomized value, and for complex nodes, a null value. For a complex node with a descendant text node, a separate entry is stored for the descendant text node in the relational table.
摘要:
Techniques are provided for efficiently evaluating XML queries that conform to an extension of an XML language (e.g., XQuery or XPath). The extension allows XML queries to have full-text search capabilities. Such an XML query is compiled to generate a tree of nodes that correspond to one or more conditions in the full-text portion of the query. In one technique, the amount of memory for the execution state of the tree is determined at compile time and allocated only once throughout execution of the query. In another technique, to ensure at most a single scan of a document, all the words or phrases in the full-text portion of an XML query are located before any of the other conditions in the full-text portion are evaluated. In another technique, the elements of the full-text portion of an XML query are analyzed to determine, based at least in part on cost, which evaluation strategy, of a plurality of evaluation strategies, should be employed.
摘要:
A method and apparatus are provided for building and using a persistent XML tree index for navigating an XML document. The XML tree index is stored separately from the XML document content, and thus is able to optimize performance through the use of fixed-sized index entries. The XML document hierarchy need not be constructed in volatile memory, so creating and using the XML tree index scales even for large documents. To evaluate a path expression including descendent or ancestral syntax, navigation links can be read from persistent storage and used directly to find the nodes specified in the path expression. The use of an abstract navigational interface allows applications to be written that are independent of the storage implementation of the index and the content. Thus, the XML tree index can index documents stored at least in a database, a persistent file system, or as a sequence of in memory.
摘要:
A method, device, and non-transitory computer-readable storage medium are provided for efficiently registering a relational schema. In co-compilation and data guide approaches, a subset of entities from schema descriptions are selected for physical registration, and other entities from the schema descriptions are not physically registered. In the co-compilation approach, a first schema description references a second schema description, and the subset includes a set of entities from the second schema description that are used by the first schema description. In the data guide approach, the subset includes entities that are used by a set of structured documents. In a pay-as-you-go approach, schema registration includes logically registering entities without creating relational database structures corresponding to the entities. A database server may execute database commands that reference the logically registered entities. A request to store data for the entities may be executed by creating relational database structures to store the data.
摘要:
A method and apparatus is provided for efficiently searching and navigating XML data stored in a relational database. When storing a collection of XML documents, certain scalar elements may be shredded and stored in a relational table, whereas unstructured data may be stored as a CLOB or BLOB column. The approach includes identifying a reference address to within an XML tree index entry and storing the address in an xmltable index. The tree index entry allows for navigation in all axes. A path-based expression may be evaluated in the context of the reference address of the LOB. The result of the evaluation identifies another XML tree index entry containing a LOB locator used to retrieve the content from the document. The tree index, node index, and secondary function indexes are used together to enhance the performance of querying the XML data.