Patent ID: 7634498

Claim:
A computer-executed method of retrieving XML data from a database, the method comprising: creating a primary table structure to hold XML data as a binary large object in an XML column, wherein each row in the primary table comprises a primary key; creating a primary XML index relating to the primary table structure, where the primary XML index includes a first XML path to a node table; populating the primary table and the primary XML index, wherein the primary XML index is populated by shredding XML values stored as the binary large object in the XML column of the primary table, and wherein the XML index preserves document order and structure by duplicating a respective primary key from the primary table and combining it with an XML node identifier for each entry in each node table; creating an alternate secondary path index in a form of (HID, HID value, PK, XID) to reduce a number of join operations for queries on the primary XML index table, wherein HID represents a hierarchical identifier, HID value represents a path efficiency, PK represents a primary key, and XID represents an XML node identifier; querying on the primary table, which then uses the created XML path indexes by directing the query to a location identified in the XML index node table to satisfy the query, whereby XML data is retrieved from the database; and retaining the primary table and primary XML index so that subsequent queries execute faster than an initial query.