摘要:
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, 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.
摘要:
Techniques are provided for searching within a collection of XML documents. A relational table stores an entry for each node of a set of nodes in a collection of XML documents. Each entry of the relational table stores an order key and a path identifier along with the atomized value of the node. Instead of storing the atomized value in a full-text index, a virtual column can 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 described herein for automatically generating multiple interrelated database tables to store XML data, while ensuring that each such table has no more than the maximum DBMS-allowed number of columns. In response to the registration of an XML schema with a database server, the server determines whether any of the elements specified in the XML schema are complex elements that have more than a threshold number of descendant elements. If a complex element has more than the threshold number of descendant elements, then the server automatically generates one or more separate “out-of-line” database tables for storing at least some of those descendant elements, so that the table created to store the complex element will have no more than the permitted number of columns. Each of the out-of-line database tables is similarly generated so as to have no more than the permitted number of columns.
摘要:
A method, computing device, and a non-transitory computer-readable medium are provided for performing a context-aware search by finding a set of nodes that are mapped to a given text or other value and, for each node in the set of nodes, performing a reverse path lookup to determine whether the node satisfies a given context. The query processor performs the reverse path lookup for a node by traversing up a node tree away from the node, using a stored mapping from the node to a parent of the node. Using mappings from nodes to parent nodes, the node tree is traversed backwards from the node up to distant ancestor nodes through parent nodes. An optimizer instructs the query processor to perform a value-based portion of the search before a path-based portion of the search based on value distribution statistics and path distribution statistics.
摘要:
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 described herein for automatically generating multiple interrelated database tables to store XML data, while ensuring that each such table has no more than the maximum DBMS-allowed number of columns. In response to the registration of an XML schema with a database server, the server determines whether any of the elements specified in the XML schema are complex elements that have more than a threshold number of descendant elements. If a complex element has more than the threshold number of descendant elements, then the server automatically generates one or more separate “out-of-line” database tables for storing at least some of those descendant elements, so that the table created to store the complex element will have no more than the permitted number of columns. Each of the out-of-line database tables is similarly generated so as to have no more than the permitted number of columns.
摘要:
Disclosed is a method, system, and program product for providing an efficient mechanism to provide updateable relational views over XML. This will allow application developers to write both queries and updates using a relational (SQL) syntax, even though the underlying data is stored as XML. According to some approaches, this is accomplished by implementing a reverse mapping from the data within the views to the node addresses of the corresponding data in the underlying XML document.
摘要:
A query may be rewritten to leverage information stored in a structured XML index. An operator in the query may be analyzed to determine an input source database object for the operator by traversing an operator tree rooted at the operator. The path expressions associated with the operator tree may be fused together to form an effective path expression for the operator. If the effective path expression directly matches a path expression derived from the index, the query may be rewritten using references to the index. Operators in a query that have effective paths that refer to data in the same index table may be grouped together. A single subquery may be written for a group of operators. Also, a structured XML index may be used as an implied schema for indexed XML data. This implied schema may be used to optimize queries that refer to the indexed XML data.
摘要:
A method, computing device, and a non-transitory computer-readable medium is provided for facilitating a context-aware search on documents stored in an unstructured database column. The database server determines whether a document stored in an unstructured database object is marked up according to a recognized markup language. Documents that conform to the markup language are indexed with value-to-node mappings and node-to-physical-location mappings to provide a context-aware search of marked up nodes within the documents. Documents that do not conform to the markup language are indexed with value-to-document mappings to provide a full-text search of the documents. The database server evaluates a context-aware search against documents that conform to the markup language within the unstructured column without requiring the user identify the documents as XML documents and store the documents in an XMLType structured column.