Patent ID: 8117190

Claim:
A method of query pattern matching, comprising: (a) generating a list of potential ancestors and a list of potential descendants; (b) sorting the list of potential ancestors and the list of potential descendants in an order of a first attribute in a database; (c) skipping over unmatchable nodes in the list of potential descendants; (d) determining whether a second attribute of a current node in the potential descendant list is less than a second attribute of a current node in the potential ancestor list; (e) determining whether a first attribute of the current node of the potential ancestor list is less than a first attribute of the current node of the potential descendant list, and whether a level number of the current node of the potential descendant list is equal to a level number plus one of the current node of the potential ancestor list; and (f) appending to an output join list, based upon a result from (e), a node pair comprising the current node of the potential ancestor list and the current node of the potential descendant list.