In recent years, there are many database systems that allow storage and querying of extensible Markup Language data (“XML data”). Though there are many evolving standards for querying XML, all of them include some variation of XPath. However, database systems are usually not optimized to handle XPath queries, and the query performance of the database systems leaves much to be desired. In specific cases where an XML schema definition may be available, the structure and datatypes used in XML instance documents may be known. However, in cases where an XML schema definition is not available, and the documents to be searched do not conform to any schema, there are no efficient techniques for querying using XPath.
Some database systems may use ad-hoc mechanisms to satisfy Xpath queries that are run against documents where the schema of the documents is not known. For example, a database system may satisfy an XPath query by performing a full scan of all documents. While a full scan of all documents can be used to satisfy all XPath queries, the implementation would be very slow due to the lack of indexes.
Another way to satisfy XPath queries involves the use of text keywords. Specifically, many database systems support text indexes, and these could be used to satisfy certain XPaths. However, this technique can only satisfy a small subset of XPath queries. Thus, there have been no effective indexing techniques in existing database systems that can be used to handle a wide variety of XPath queries.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.