Global query normalization to improve XML index based rewrites for path subsetted index

Information

  • Patent Grant
  • 7991768
  • Patent Number
    7,991,768
  • Date Filed
    Thursday, November 8, 2007
    16 years ago
  • Date Issued
    Tuesday, August 2, 2011
    13 years ago
Abstract
Techniques for processing a query that includes a path expression are provided. A query processor determines whether an XML index may be used to execute the query instead of having to scan multiple XML documents. The query is parsed and normalized, which results in multiple normalized path expressions that are based on the original path expression. If the XML index is a path-subsetted index, then the query processor generates annotated path expressions based on the normalized path expressions. The query processor determines whether each of the annotated path expressions is satisfiable by the path-subsetted XML index. If so, then the XML index is used to process the query.
Description
RELATED APPLICATIONS

This application is related to U.S. patent application Ser. No. 11/059,665, entitled “EFFICIENT QUERIBILITY AND MANAGEABILITY OF AN XML INDEX WITH PATH SUBSETTING”, filed by Ashish Thusoo et al. on Feb. 15, 2005, the entire contents of which is hereby incorporated by reference for all purposes as if fully set forth herein.


This application is related to U.S. patent application Ser. No. 11/401,613, entitled “A MECHANISM FOR IMPROVING PERFORMANCE ON XML OVER XML DATA USING PATH SUBSETTING”, filed by Asha Tarachandani, et al. on Apr. 10, 2006, the entire contents of which is hereby incorporated by reference for all purposes as if fully set forth herein.


FIELD OF THE INVENTION

The present invention relates to managing information and, more specifically, efficiently managing and querying XML documents.


BACKGROUND

In recent years, database systems that allow storage and querying of eXtensible Markup Language data (“XML data”) have been developed. Though there are many evolving standards for querying XML, most of them usually include some variation of XPath. XPath is a language that describes a way to locate and process items in XML documents by using an addressing syntax based on a path through the document's logical structure or hierarchy. The portion of an XML document identified by an XPath “path expression” is the portion that resides, within the structure of the XML document, at the end of any path that matches the path expression.


A query that uses a path expression to identify one or more specific pieces of XML data is referred to herein as a path-based query. The process of determining which XML data corresponds to the path designated in a path-based query is referred to as “evaluating” the path expression.


Unfortunately, even database systems that have built-in support for storing XML data are usually not optimized for handling path-based queries, and the query performance of the databases systems leaves much to be desired. In specific cases where an XML schema definition may be available, the structure and data types used in XML instance documents may be used to optimize path-based queries. 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 path-based querying.


Some database systems may use ad-hoc mechanisms to satisfy path-based queries that are run against documents where the schema of the documents is not known. For example, a database system may satisfy a path-based query by performing a full scan of all stored XML documents. While a full scan of all documents can be used to satisfy all path-based queries, the implementation would be very slow due to the lack of indexes.


Another way to satisfy path-based queries involves the use of text keywords. Specifically, many database systems support text indexes, and these could be used to satisfy certain path expressions. However, this technique can only satisfy a small subset of path-based queries, and in particular, cannot satisfy path-based querying.


Consequently, XML indexes that can be used to quickly evaluate a path-based query have been developed. An example of such an XML index is described in U.S. patent application Ser. No. 10/884,311, entitled “INDEX FOR ACCESSING XML DATA”, filed by Sivasankaran Chandrasekar et al., on Jul. 2, 2004, the entire contents of which is hereby incorporated by reference for all purposes as if fully set forth herein. XML indexes enable XML data to be searched without a sequential scan of all of the XML data. XML indexes are typically built using all available XML data in the database.


However, XML documents that are being stored in a database may include several paths that will never be used in a path-based query. For example, document-oriented XML data may include formatting elements that will typically not be used in path-based queries. Therefore, any XML path-based index that indexes all paths in XML documents stored in a database will needlessly include data that will not be used. As more paths are indexed, and the index grows, execution of queries that use such an index are likely to become slower.


U.S. patent application Ser. Nos. 11/059,665 and 11/401,613 describe how only those path expressions that are more likely to be the subject of a path-based query are indexed. Such indexes are referred to herein as path-subsetted indexes. A path-subsetted index thus indexes a proper (or strict) subset of the XML nodes in a document. Path-subsetted indexes are defined in at least two ways. In the case of an INCLUDE path-subsetted XML index, the subset of XML nodes to be indexed is specified using a set of one or more path expressions. All XML nodes that fall within the sub-tree rooted at any node matching one of the path expressions in the set are indexed.


An EXCLUDE path-subsetted XML index is defined in a similar fashion. An EXCLUDE path-subsetted XML index is defined by specifying a set of one or more path expressions. The index does not index any XML node that is within the sub-tree rooted at any node matching any of the path expressions in the set.


Hereinafter, path expressions that correspond to indexed nodes are referred to as “subsetted paths.”


An XML index is typically used for node identification as well as fragment extraction. Node identification is the process of identifying nodes matching a certain criteria (e.g., nodes whose corresponding path expression is equal to a subsetted path). Fragment extraction is the process of constructing document fragments. Because fragment extraction requires namespace patching, an INCLUDE path-subsetted XML index may also index all nodes in a subsetted path from the document root to any indexed XML node.


A path expression in a query may not be “satisfiable” by a path-subsetted XML index. A path expression is “satisfiable” by a path-subsetted XML index if all XML nodes that match the path expression are indexed in the path-subsetted XML index.


With a path-subsetted index, new documents that are being added to a database may be quickly and efficiently parsed such that only path expressions that match a “path subsetting” rule are added to the index. In addition, an incoming path-based query may be quickly and efficiently examined to determine whether the specified path could be satisfied by an index before attempting to evaluate the path expression using the index.


However, database systems typically normalize received path-based queries before the database server determines whether an index may be used to process the path-based queries. Under a typical normalization phase, a complex path expression is decomposed into multiple “mini” path expressions. The database system then determines whether each of the “mini” path expressions is “satisfiable” by an index. If any of the “mini” path expressions are not satisfiable by an index, then an index is not used to retrieve data that satisfies any of the “mini” path expressions.


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.





BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:



FIG. 1 is a flow diagram that depicts how a path-based query may be processed to determine whether a path-subsetted XML index may be used to execute the path-based query, according to an embodiment of the invention;



FIG. 2 is a block diagram that depicts annotated path expressions modeled as trees of nodes, according to an embodiment of the invention; and



FIG. 3 is a block diagram that depicts a computer system upon which an embodiment of the invention may be implemented.





DETAILED DESCRIPTION

In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention.


General Overview

Techniques are provided that improve the performance of path-based queries that are not satisfiable by a path-subsetted XML index. When a query processor analyzes and path-based query and generates multiple path expressions, the query processor also maintains information about the original path expression. The query processor uses this information to determine whether the multiple path expressions are satisfiable by the path-subsetted XML index. The multiple path expressions may be modified with the information and then compared to the subsetted paths of the XML index. If each of the modified path expressions is satisfiable by the path-subsetted XML index, then the path-subsetted XML index may be used to process the path-based query.


For purposes of brevity, a path expression is referred to herein as a “path.”


Although the following description refers to a path-based query that specifies a single path, embodiments of the invention are also applicable to path-based queries that specify multiple paths.


Example Path-Subsetted XML Index

Although not so limited, embodiments of the invention are described in the context of a path-subsetted XML index that indexes nodes that satisfy the following paths.


/PurchaseOrder/Reference


/PurchaseOrder/User


/PurchaseOrder/LineItems/LineItem/Part/@Id


In an embodiment, a path-subsetted XML index indexes the following three sets of nodes: (1) all nodes that match any of the specified paths; (2) all descendants of any of the nodes in (1); and (3) all ancestor nodes of any nodes in (1). For example, given specified path “/PurchaseOrder/Reference”, the above path-subsetted XML index may also index all XML nodes whose paths match “/PurchaseOrder[Reference]” or “/PurchaseOrder/Reference” or are subsumed by “/PurchaseOrder/Reference//*.” Similarly, given the specified path “PurchaseOrder/User”, the above path-subsetted XML index may also index all XML nodes whose paths match “/PurchaseOrder[User]” or “/PurchaseOrder/User” or are subsumed by “/PurchaseOrder/User//*”.


Example Query

To continue the example, after the above path-subsetted XML index is generated, the following path-based query is received:

















select object_value



from PURCHASEORDER



where XMLExists



(



  ‘$p/PurchaseOrder[Reference=“REFERENCE”]’



  passing object_value as “p”



)










Execution of this path-based query retrieves all PurchaseOrder nodes that have a Reference child whose text value is the string “REFERENCE”. In this example, the path-based query conforms to the SQL/XML query language. The path-based query may have been submitted by a user or may have been generated from another path-based query. The other path-based query may conform to another query language, such as the XQuery query language.


Normalization

In typical database systems, such as Oracle XML DB™, many queries undergo normalization processing. A purpose of normalization is to decompose “complex” paths, which cannot be evaluated by a single operator, into “simple” paths that can be individually evaluated, e.g., using an index. The results of the individual evaluations are then joined based on certain constraints, such as a comparison among order key values. An example of a simple path is one that does not include any predicates, such as “/PurchaseOrder/User”. An example of a complex path is one that includes one or more predicates, such as “/PurchaseOrder/User[@Id=123]”.


A path-based query that is not yet normalized is referred to herein as an “original query.” Each path specified in an original query is referred to herein as an “original path.” Thus, an original query may include multiple original paths.


An original query may or may not be the query that a database system receives from a client. For example, an original query may be a SQL/XML query that a database system generates from an XQuery query.


During the normalization phase, an original query, as in the example above, is transformed into an equivalent query without complex paths. The equivalent query that results from a normalization phase is referred to herein as a “normalized query.” One stage of normalization involves decomposing the original path into multiple paths. The multiple paths that are generated from the original path during a normalization phase are referred to herein as “normalized paths.” Thus, the normalized query that is generated during a normalization phase includes the normalized paths.


As an example, the example original query described above may be rewritten to the following normalized query:














SELECT SYS_MAKEXML(0,“PURCHASEORDER”.“XMLDATA”) “OBJECT_VALUE”


FROM “XMARK”.“PURCHASEORDER” “PURCHASEORDER”


WHERE CASE WHEN EXISTS


(


  SELECT NULL “SYS_XQCON2SEQ(VALUE(P))”


  FROM


  (


    SELECT VALUE(KOKBF$) “COLUMN_VALUE”


    FROM TABLE


    (


      “SYS”.“XMLSEQUENCE”


      (


        EXTRACT(SYS_MAKEXML(0,“PURCHASEORDER”.“XMLDATA”),


        ‘/PurchaseOrder’)


      )


    ) “KOKBF$”


  ) “P”


  WHERE EXISTS


  (


    SELECT NULL “SYS_XQCON2SEQ(VALUE(P))” FROM


    (


      SELECT VALUE(KOKBF$) “COLUMN_VALUE”


      FROM TABLE


      (


        “SYS”.“XMLSEQUENCE”


        (


          EXTRACT(“P”.“COLUMN_VALUE”,‘/PurchaseOrder/


          Reference’)


        )


      ) “KOKBF$”


    ) “P”


    WHERE TO_CHAR(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL


    (


      SYS_XQEXTRACT(“P”.“COLUMN_VALUE”,‘/Reference’),1,5


      0


    ),50,1,0))=‘REFERENCE’


  )


)


THEN 1 ELSE 0 END =1









Normalization of the original query transforms the XMLExists function in the original query to an EXISTS sub-query in the normalized query. The EXISTS sub-query includes three normalized paths: “/PurchaseOrder”, “/PurchaseOrder/Reference”, and “/Reference”.


Normalized Query Rewrite

After normalization, the normalized query goes through a rewrite phase where checks are performed on each normalized path in the normalized query. During a typical rewrite phase, each EXTRACT operator is analyzed and rewritten independent of other EXTRACT operators into a sub-query that accesses a XML index. However, because “/PurchaseOrder” is not satisfiable by the path-subsetted XML index (i.e., “/PurchaseOrder” is not one of the subsetted paths of the index), the corresponding EXTRACT operator is not rewritten to use the path-subsetted XML index. Based on an analysis of only the normalized query (referred to herein as “local query analysis”), the database server cannot conclude that the EXTRACT operator corresponding to “/PurchaseOrder” can use the path-subsetted XML index because not all PurchaseOrder nodes are stored in the path-subsetted XML index. Instead, only PurchaseOrder nodes that are in the path from the document root to any indexed XML node (e.g., “/PurchaseOrder/Reference” and “/PurchaseOrder[Reference]” nodes in this example) are indexed in the path-subsetted XML index.


Global Query Analysis

According to an embodiment of the invention, a path-based query, from which the normalized query is derived, is analyzed to determine whether a path-subsetted XML index can be used to execute a normalized path. This type of analysis is referred to herein as “global query analysis.” With global query analysis, a database system can know that, in the normalized query above, a PurchaseOrder element in the output of the EXTRACT operator that corresponds to normalized path “/PurchaseOrder” can affect the overall query result if the PurchaseOrder element has a child element named “Reference”. All such PurchaseOrder nodes must be indexed by the path-subsetted XML index. For example, if the path-subsetted XML index includes a path table, then the path table must include an entry for a “/PurchaseOrder[Reference]” path. Therefore, with global query analysis, there is sufficient information to rewrite the EXTRACT operators in the normalized query to use the path-subsetted XML index.


In an embodiment, information from the normalization phase is maintained in order to determine whether normalized paths may be rewritten to use a path-subsetted XML index. For example, when the original path is decomposed into multiple normalized paths, the normalized paths are associated with the original path. A path tree may be generated where the root node in the path tree corresponds to the original path. The root node has multiple child nodes that each correspond to a different normalized path.


As another example, information from the normalization phase may include data that indicates that the EXTRACT operators in the normalized query originate from the same (e.g., XMLExists) operator in the original query.


With this information, the database system is able to use the path-subsetted XML index to process the EXTRACT operators (i.e., that correspond to the normalized paths) in the normalized query. Determining that operators may be processed using an index almost always leads to better execution plans relative to execution plans that do not include an index.


Annotated Normalized Paths

In an embodiment, one or more of the normalized paths (or copies of the normalized paths) are annotated with information from the original path. Given the example above, the original path is “/PurchaseOrder[Reference=‘REFERENCE’]” and the normalized paths are “/PurchaseOrder”, “/PurchaseOrder/Reference”, and “/Reference”. At least two of these normalized paths are annotated to generate the following annotated paths: “/PurchaseOrder[Reference]” corresponding to normalized path “/PurchaseOrder” and “/PurchaseOrder/Reference” corresponding to normalized path “/Reference”. The normalized path “/PurchaseOrder/Reference” is not required to be annotated.


Each annotated path (including any non-annotated paths) is compared against one or more subsetted paths associated with an XML index. If any of the annotated paths (or non-annotated paths) does not match any of the subsetted paths associated with an XML index, then that XML index cannot be used to process the normalized query.


Functional Overview


FIG. 1 is a flow diagram that depicts how a path-based query may be processed to determine whether a path-subsetted XML index may be used to execute the path-based query, according to an embodiment of the invention. Although the following description of FIG. 1 refers to a database system performing certain steps, multiple processes within the database system may be performing the various steps. Furthermore, embodiments of the invention are not limited to the type of database system. For example, the database system may comprise a multi-node database server or a single node database server. As another example, the database system may be a “shared everything” or a “shared nothing” database system.


At step 102, a database system receives a query that specifies a particular path. At step 104, the database system normalizes the query, which includes generating a plurality of normalized paths that are each derived from the particular path.


At step 106, the database system generates, from one or more of the normalized paths, one or more temporary paths based on the particular path. At step 108, the database system determines whether each of the temporary paths is subsumed by a path of a node that is indexed by a path-subsetted XML index. A first path is “subsumed” by a second path if the node represented by the second path includes the node represented by the first path. For example, given the above path-subsetted XML index, “/PurchaseOrder” is not subsumed by “/PurchaseOrder/Reference”; however, “/PurchaseOrder/Reference/@id” is subsumed by “PurchaseOrder/Reference”. Also, “/PurchaseOrder[Reference]” is subsumed by “/'PurchaseOrder/Reference.”


If each of the temporary paths is subsumed by a path of a node that is indexed by a path-subsetted XML index, then, at step 110, the database system uses the path-subsetted XML index for each of the normalized paths.


Tree Comparison


FIG. 2 is a block diagram that depicts annotated paths modeled as trees of nodes, according to an embodiment of the invention. FIG. 2 depicts two sets of paths: (a) subsetted paths 202A-B of the XML index defined previously and (b) annotated paths 204A-C that correspond to the normalized paths described previously. Although normalized path “/PurchaseOrder/Reference” is not required to be annotated, for purposes of brevity, that path is also referred to as an annotated path (e.g., annotated path 204B).


For each subsetted path 202 and annotated path 204, a tree of nodes is generated. Tree 206A is generated from subsetted path 202A, tree 206B is generated from subsetted path 202B, and so forth. Similarly, tree 208A is generated from annotated path 204A, tree 208B is generated from annotated path 204B, and so forth.


Alternatively, a single tree may be generated from subsetted paths 202A-C. In that case, the common root node of that single tree would correspond to the PurchaseOrder element and the immediate children nodes of the root node would correspond to the Reference, User, and LineItems elements. The nodes corresponding to the LineItem, Parts, and @Id elements would still be descendants of the node corresponding to the LineItems element.


Each tree 208 is compared, node by node, to each tree 206 until a match is achieved. If one of trees 208A-C does not match any of trees 206A-C, then the XML index corresponding to subsetted paths 202A-C cannot be used to process the normalized query corresponding to annotated paths 204A-C. In the example depicted in FIG. 2, each of trees 208A-C matches tree 206A. Therefore, the XML index corresponding to subsetted paths 202A-C is used to process the example normalized query described previously.


Hardware Overview


FIG. 3 is a block diagram that illustrates a computer system 300 upon which an embodiment of the invention may be implemented. Computer system 300 includes a bus 302 or other communication mechanism for communicating information, and a processor 304 coupled with bus 302 for processing information. Computer system 300 also includes a main memory 306, such as a random access memory (RAM) or other dynamic storage device, coupled to bus 302 for storing information and instructions to be executed by processor 304. Main memory 306 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 304. Computer system 300 further includes a read only memory (ROM) 308 or other static storage device coupled to bus 302 for storing static information and instructions for processor 304. A storage device 310, such as a magnetic disk or optical disk, is provided and coupled to bus 302 for storing information and instructions.


Computer system 300 may be coupled via bus 302 to a display 312, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 314, including alphanumeric and other keys, is coupled to bus 302 for communicating information and command selections to processor 304. Another type of user input device is cursor control 316, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 304 and for controlling cursor movement on display 312. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane.


The invention is related to the use of computer system 300 for implementing the techniques described herein. According to one embodiment of the invention, those techniques are performed by computer system 300 in response to processor 304 executing one or more sequences of one or more instructions contained in main memory 306. Such instructions may be read into main memory 306 from another machine-readable medium, such as storage device 310. Execution of the sequences of instructions contained in main memory 306 causes processor 304 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and software.


The term “machine-readable medium” as used herein refers to any medium that participates in providing data that causes a machine to operation in a specific fashion. In an embodiment implemented using computer system 300, various machine-readable media are involved, for example, in providing instructions to processor 304 for execution. Such a medium may take many forms, including but not limited to storage media and transmission media. Storage media includes both non-volatile media and volatile media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 310. Volatile media includes dynamic memory, such as main memory 306. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise bus 302. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications. All such media must be tangible to enable the instructions carried by the media to be detected by a physical mechanism that reads the instructions into a machine.


Common forms of machine-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, a CD-ROM, any other optical medium, punchcards, papertape, any other physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read.


Various forms of machine-readable media may be involved in carrying one or more sequences of one or more instructions to processor 304 for execution. For example, the instructions may initially be carried on a magnetic disk of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 300 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data on bus 302. Bus 302 carries the data to main memory 306, from which processor 304 retrieves and executes the instructions. The instructions received by main memory 306 may optionally be stored on storage device 310 either before or after execution by processor 304.


Computer system 300 also includes a communication interface 318 coupled to bus 302. Communication interface 318 provides a two-way data communication coupling to a network link 320 that is connected to a local network 322. For example, communication interface 318 may be an integrated services digital network (ISDN) card or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 318 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 318 sends and receives electrical, electromagnetic or optical signals that carry digital data streams representing various types of information.


Network link 320 typically provides data communication through one or more networks to other data devices. For example, network link 320 may provide a connection through local network 322 to a host computer 324 or to data equipment operated by an Internet Service Provider (ISP) 326. ISP 326 in turn provides data communication services through the world wide packet data communication network now commonly referred to as the “Internet” 328. Local network 322 and Internet 328 both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 320 and through communication interface 318, which carry the digital data to and from computer system 300, are exemplary forms of carrier waves transporting the information.


Computer system 300 can send messages and receive data, including program code, through the network(s), network link 320 and communication interface 318. In the Internet example, a server 330 might transmit a requested code for an application program through Internet 328, ISP 326, local network 322 and communication interface 318.


The received code may be executed by processor 304 as it is received, and/or stored in storage device 310, or other non-volatile storage for later execution. In this manner, computer system 300 may obtain application code in the form of a carrier wave.


In the foregoing specification, embodiments of the invention have been described with reference to numerous specific details that may vary from implementation to implementation. Thus, the sole and exclusive indicator of what is the invention, and is intended by the applicants to be the invention, is the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction. Any definitions expressly set forth herein for terms contained in such claims shall govern the meaning of such terms as used in the claims. Hence, no limitation, element, property, feature, advantage or attribute that is not expressly recited in a claim should limit the scope of such claim in any way. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.

Claims
  • 1. A method comprising: receiving a query that specifies a particular path expression;normalizing the query to generate a normalized query, wherein normalizing the query comprises generating, based on the particular path expression, a plurality of normalized path expressions;generating, based on the particular path expression, from a subset of the plurality of normalized path expressions, one or more temporary path expressions;determining whether each of the one or more temporary path expressions is subsumed by a path of a node that is indexed by a path-subsetted XML index that is associated with one or more subsetted path expressions that indicate a set of one or more nodes that are indexed by said path-subsetted XML index; andin response to determining that each of the one or more temporary path expressions is subsumed by a path of a node that is indexed by said path-subsetted XML index, using the path-subsetted XML index to process the plurality of normalized path expressions;wherein the method is performed by one or more computers.
  • 2. The method of claim 1, wherein generating the one or more temporary path expressions includes modifying the subset of the plurality of normalized path expressions to include information from the particular path expression.
  • 3. The method of claim 1, wherein the query conforms to the SQL/XML query language.
  • 4. The method of claim 3, further comprising: receiving a previous query that conforms to the XQuery query language; andgenerating the query based on the previous query.
  • 5. The method of claim 1, wherein at least a subset of the one or more subsetted path expressions are specified in a definition of the path-subsetted XML index.
  • 6. The method of claim 1, wherein: each subsetted path expression of the one or more subsetted path expressions is not in a particular set of path expressions;the particular set of path expressions is specified in a definition of the path-subsetted XML index; andeach path expression in the particular set of path expressions specifies one or more nodes that are not indexed by the path-subsetted XML index.
  • 7. The method of claim 1, wherein each normalized path expression in a subset of the plurality of normalized path expressions is subsumed by a subsetted path expression of the one or more subsetted path expressions.
  • 8. The method of claim 1, further comprising: for each temporary path expression of the one or more temporary path expressions, generating a first tree of nodes, wherein each node in the first tree corresponds to an element in said each temporary path expression; andfor each subsetted path expression of the one or more subsetted path expressions, generating a second tree of nodes, wherein each node in the second tree corresponds to an element in said each subsetted path expression;wherein determining whether each of the one or more temporary path expressions is subsumed by a path of a node that is indexed by the path-subsetted XML index includes determining whether each first tree is equivalent to one of the second trees.
  • 9. The method of claim 1, wherein: the normalized query includes a plurality of extract operators, none of which appear in said query;each extract operator of the plurality of extract operators takes as input a different normalized path expression of the plurality of normalized path expressions; andusing the path-subsetted XML index to process the plurality of normalized path expressions comprises rewriting each extract operator to use the path-subsetted XML index.
  • 10. One or more non-transitory machine-readable media storing instructions which, when executed by one or more processors, cause: receiving a query that specifies a particular path expression;normalizing the query to generate a normalized query, wherein normalizing the query comprises generating, based on the particular path expression, a plurality of normalized path expressionsgenerating, based on the particular path expression, from a subset of the plurality of normalized path expressions, one or more temporary path expressions;determining whether each of the one or more temporary path expressions is subsumed by a path of a node that is indexed by a path-subsetted XML index that is associated with one or more subsetted path expressions that indicate a set of one or more nodes that are indexed by said path-subsetted XML index; andin response to determining that each of the one or more temporary path expressions is subsumed by a path of a node that is indexed by said path-subsetted XML index, using the path-subsetted XML index to process the plurality of normalized path expressions.
  • 11. The one or more non-transitory machine-readable media of claim 10, wherein generating the one or more temporary path expressions includes modifying the subset of the plurality of normalized path expressions to include information from the particular path expression.
  • 12. The one or more non-transitory machine-readable media of claim 10, wherein the query conforms to the SQL/XML query language.
  • 13. The one or more storage non-transitory machine-readable media of claim 12, wherein the instructions, when executed by the one or more processors, further cause: receiving a previous query that conforms to the XQuery query language; andgenerating the query based on the previous query.
  • 14. The one or more non-transitory machine-readable media of claim 10, wherein at least a subset of the one or more subsetted path expressions are specified in a definition of the path-subsetted XML index.
  • 15. The one or more non-transitory machine-readable media of claim 10, wherein: each subsetted path expression of the one or more subsetted path expressions is not in a particular set of path expressions;the particular set of path expressions is specified in a definition of the path-subsetted XML index; andeach path expression in the particular set of path expressions specifies one or more nodes that are not indexed by the path-subsetted XML index.
  • 16. The one or more non-transitory machine-readable media of claim 10, wherein each normalized path expression in a subset of the plurality of normalized path expressions is subsumed by a subsetted path expression of the one or more subsetted path expressions.
  • 17. The one or more non-transitory machine-readable media of claim 10, wherein the instructions, when executed by the one or more processors, further cause: for each temporary path expression of the one or more temporary path expressions, generating a first tree of nodes, wherein each node in the first tree corresponds to an element in said each temporary path expression; andfor each subsetted path expression of the one or more subsetted path expressions, generating a second tree of nodes, wherein each node in the second tree corresponds to an element in said each subsetted path expression;wherein determining whether each of the one or more temporary path expressions is subsumed by a path of a node that is indexed by the path-subsetted XML index includes determining whether each first tree is equivalent to one of the second trees.
  • 18. The one or more non-transitory machine-readable media of claim 10, wherein: the normalized query includes a plurality of extract operators, none of which appear in said query;each extract operator of the plurality of extract operators takes as input a different normalized path expression of the plurality of normalized path expressions; andusing the path-subsetted XML index to process the plurality of normalized path expressions comprises rewriting each extract operator to use the path-subsetted XML index.
US Referenced Citations (172)
Number Name Date Kind
5210686 Jernigan May 1993 A
5295261 Simonetti Mar 1994 A
5369763 Biles Nov 1994 A
5404513 Powers et al. Apr 1995 A
5410691 Taylor Apr 1995 A
5454101 Mackay et al. Sep 1995 A
5467471 Bader Nov 1995 A
5524240 Barbara et al. Jun 1996 A
5530849 Hanushevksy et al. Jun 1996 A
5544360 Lewak et al. Aug 1996 A
5546571 Shan et al. Aug 1996 A
5568640 Nishiyama et al. Oct 1996 A
5643633 Telford et al. Jul 1997 A
5680614 Bakuya et al. Oct 1997 A
5701467 Freeston Dec 1997 A
5724577 Exley et al. Mar 1998 A
5734887 Kingberg et al. Mar 1998 A
5838965 Kavanagh et al. Nov 1998 A
5842212 Balluvio Nov 1998 A
5870590 Kita et al. Feb 1999 A
5878415 Olds Mar 1999 A
5917492 Bereiter et al. Jun 1999 A
5921582 Gusack Jul 1999 A
5964407 Sandkleiva Oct 1999 A
5974407 Sacks Oct 1999 A
5987506 Carter et al. Nov 1999 A
6003040 Mital et al. Dec 1999 A
6038563 Bapat et al. Mar 2000 A
6055544 DeRose et al. Apr 2000 A
6061684 Glasser et al. May 2000 A
6101500 Lau Aug 2000 A
6111578 Tesler Aug 2000 A
6112209 Gusack Aug 2000 A
6128610 Srinivasan et al. Oct 2000 A
6141655 Johnson et al. Oct 2000 A
6154741 Feldman Nov 2000 A
6182121 Wlaschin Jan 2001 B1
6189012 Mital et al. Feb 2001 B1
6192273 Igel et al. Feb 2001 B1
6192373 Haegele Feb 2001 B1
6199195 Goodwin et al. Mar 2001 B1
6208993 Shadmon Mar 2001 B1
6236988 Aldred May 2001 B1
6263332 Nasr et al. Jul 2001 B1
6269380 Terry et al. Jul 2001 B1
6279006 Shigemi et al. Aug 2001 B1
6279007 Uppala Aug 2001 B1
6298349 Toyoshima et al. Oct 2001 B1
6330573 Salisbury et al. Dec 2001 B1
6343287 Kumar et al. Jan 2002 B1
6356920 Vandersluis Mar 2002 B1
6366934 Cheng et al. Apr 2002 B1
6370537 Gilbert et al. Apr 2002 B1
6427123 Sedlar Jul 2002 B1
6470344 Kothuri et al. Oct 2002 B1
6487546 Witkowski Nov 2002 B1
6496842 Lyness Dec 2002 B1
6519597 Cheng et al. Feb 2003 B1
6539398 Hannan et al. Mar 2003 B1
6549916 Sedlar Apr 2003 B1
6571231 Sedlar May 2003 B2
6584459 Chang et al. Jun 2003 B1
6604100 Fernandez et al. Aug 2003 B1
6609121 Ambrosini et al. Aug 2003 B1
6636845 Chau et al. Oct 2003 B2
6643633 Chau et al. Nov 2003 B2
6662342 Marcy Dec 2003 B1
6684227 Duxbury Jan 2004 B2
6697805 Choquier et al. Feb 2004 B1
6704739 Craft et al. Mar 2004 B2
6704747 Fong Mar 2004 B1
6708186 Claborn et al. Mar 2004 B1
6718322 Brye Apr 2004 B1
6725212 Couch et al. Apr 2004 B2
6754661 Hallin et al. Jun 2004 B1
6772350 Belani et al. Aug 2004 B1
6785673 Fernandez et al. Aug 2004 B1
6801224 Lewallen Oct 2004 B1
6826553 DaCosta et al. Nov 2004 B1
6826727 Mohr et al. Nov 2004 B1
6836778 Manikutty et al. Dec 2004 B2
6836857 Ten-Hove et al. Dec 2004 B2
6920457 Pressmar Jul 2005 B2
6964025 Angiulo et al. Nov 2005 B2
6996571 McConnell Feb 2006 B2
7013425 Kataoka Mar 2006 B2
7031956 Lee et al. Apr 2006 B1
7043488 Bauer et al. May 2006 B1
7080094 Dapp et al. Jul 2006 B2
7096224 Murthy et al. Aug 2006 B2
7120645 Manikutty et al. Oct 2006 B2
7139746 Shin et al. Nov 2006 B2
7143397 Imaura Nov 2006 B2
7162485 Gottlob et al. Jan 2007 B2
7171404 Lindblad et al. Jan 2007 B2
7171407 Barton et al. Jan 2007 B2
7216127 Auerbach May 2007 B2
7287023 Fan et al. Oct 2007 B2
7315852 Balmin et al. Jan 2008 B2
7366735 Chandrasekaran et al. Apr 2008 B2
7370061 Chakraborty et al. May 2008 B2
7467157 Chen et al. Dec 2008 B1
7603347 Thusoo et al. Oct 2009 B2
7747610 Chinchwadkar et al. Jun 2010 B2
20010049675 Mandler et al. Dec 2001 A1
20020056025 Qiu et al. May 2002 A1
20020073019 Deaton Jun 2002 A1
20020078068 Krishnaprasad et al. Jun 2002 A1
20020116371 Dodds et al. Aug 2002 A1
20020116457 Eshleman et al. Aug 2002 A1
20020133484 Chau et al. Sep 2002 A1
20020143512 Shamoto et al. Oct 2002 A1
20020152267 Lennon Oct 2002 A1
20020156811 Krupa Oct 2002 A1
20020184188 Mandyam et al. Dec 2002 A1
20020184401 Kadel, Jr. et al. Dec 2002 A1
20020188613 Chakraborty et al. Dec 2002 A1
20030004937 Salmenkaita et al. Jan 2003 A1
20030009361 Hancock et al. Jan 2003 A1
20030065659 Agarwal et al. Apr 2003 A1
20030078906 Ten-Hove et al. Apr 2003 A1
20030093672 Cichowlas May 2003 A1
20030101194 Rys et al. May 2003 A1
20030131051 Lection et al. Jul 2003 A1
20030140311 Lemon et al. Jul 2003 A1
20030167456 Sabharwal Sep 2003 A1
20030172135 Bobick et al. Sep 2003 A1
20030177341 Devillers Sep 2003 A1
20030182624 Large Sep 2003 A1
20030212662 Shin et al. Nov 2003 A1
20030212664 Breining et al. Nov 2003 A1
20040010752 Chan et al. Jan 2004 A1
20040043758 Sorvari et al. Mar 2004 A1
20040044659 Judd et al. Mar 2004 A1
20040064466 Manikutty et al. Apr 2004 A1
20040068494 Tozawa et al. Apr 2004 A1
20040088320 Perry May 2004 A1
20040103105 Lindblad et al. May 2004 A1
20040148278 Milo et al. Jul 2004 A1
20040149278 Lin Aug 2004 A1
20040167864 Wang et al. Aug 2004 A1
20040176958 Salmenkaita et al. Sep 2004 A1
20040205551 Santos Oct 2004 A1
20040220912 Manikutty et al. Nov 2004 A1
20040225680 Cameron et al. Nov 2004 A1
20040230667 Wookey Nov 2004 A1
20040267760 Brundage et al. Dec 2004 A1
20050033733 Shadmon et al. Feb 2005 A1
20050038688 Collins et al. Feb 2005 A1
20050050016 Stanoi et al. Mar 2005 A1
20050050058 Jain et al. Mar 2005 A1
20050050092 Jain et al. Mar 2005 A1
20050091188 Pal et al. Apr 2005 A1
20050097084 Balmin et al. May 2005 A1
20050108630 Wasson et al. May 2005 A1
20050120031 Ishii Jun 2005 A1
20050187897 Pawar et al. Aug 2005 A1
20050228791 Thusoo et al. Oct 2005 A1
20050228792 Chandrasekaran et al. Oct 2005 A1
20050228818 Murthy et al. Oct 2005 A1
20050229158 Thusoo et al. Oct 2005 A1
20050257201 Rose et al. Nov 2005 A1
20050278616 Eller Dec 2005 A1
20050289125 Liu et al. Dec 2005 A1
20060080345 Murhy et al. Apr 2006 A1
20060129584 Hoang et al. Jun 2006 A1
20060184551 Tarachandani et al. Aug 2006 A1
20060195476 Nori et al. Aug 2006 A1
20070250527 Murthy et al. Oct 2007 A1
20080098001 Gupta et al. Apr 2008 A1
20080098019 Sthanikam et al. Apr 2008 A1
20080098020 Gupta et al. Apr 2008 A1
Foreign Referenced Citations (6)
Number Date Country
1 241 589 Sep 2002 EP
WO 2004049533 Aug 2000 WO
WO 0142881 Jun 2001 WO
WO 0159602 Aug 2001 WO
WO 0161566 Aug 2001 WO
WO 03027908 Apr 2003 WO
Related Publications (1)
Number Date Country
20090125494 A1 May 2009 US