Abstract:
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.
Abstract:
Processes, machines, and stored instructions are provided for storing posting lists for tokens in XML documents and using the posting lists to process queries. For each occurrence of a token in the XML documents, a document processor adds an entry to a list for the token. The entry for the token maps the token to documents or nodes within the documents where the tokens can be found. The document processor may also detect tags in the XML documents and, for each occurrence of a tag, add an entry to a list for the tag. The entry for the tag specifies a range of locations covered by the tag. A query processor may then receive a full text query for evaluation against XML documents, and the query processor may determine a result set for the query using the lists for the tokens and/or the lists for the tags.