Patent ID: 7698295

Claim:
A computer program product comprising a computer useable storage medium having computer readable program code programmed to perform handling of a LET binding during an XML pivot join procedure, the computer program product having operations comprising: traversing down a path summary tree generated during the XML pivot join procedure, wherein the path summary tree is configured to summarize all unique paths of an XML document; identifying a series of XPath steps under a LET binding of an XQuery “FOR, LET, WHERE, ORDER BY, and RETURN” (“FLWOR”) expression, wherein the LET binding is an association of one or more variables to one or more values in the FLWOR expression, the LET binding comprising a context step in a WHERE clause within the XQuery FLWOR expression; traversing up a path matching graph to locate a first common non-LET binding ancestor of the series of XPath steps, wherein the first common non-LET binding ancestor comprises a first ancestor reached while traversing up the path matching graph that is common to the series of XPath steps and is not a LET binding; linking bindings under the LET binding to the first common non-LET binding ancestor within the path matching graph during a path matching phase of the XML pivot join procedure, wherein the bindings under the LET binding are identified by the series of XPath steps; truncating a location identifier for each XPath step in the series of XPath steps to a location identifier of the first common non-LET binding ancestor within an XML document to provide a truncated location identifier, wherein the location identifier for each XPath step is truncated to be identical to the location identifier of the first common non-LET binding ancestor; and returning the XML document if the truncated location identifier matches a first common FOR binding of the XQuery FLWOR expression.