Loop-lifted staircase join: from XPath to XQuery
Peter A. Boncz, Torsten Grust, M. vanKeulen, Stefan Manegold, Jan Rittinger, Jens Teubner · Centrum Wiskunde & Informatica (CWI), the national research institute for mathematics and computer science in the Netherlands · 2005
Various techniques have been proposed for efficient evaluation of XPath expressions, where the XPath location steps are rooted in a single sequence of context nodes. Among these techniques, the staircase join allows to evaluate XPath location steps along arbitrary axes in at most one scan over the XML document, exploiting the XPath accelerator encoding (aka. pre/post encoding).In XQuery, however, embedded XPath sub-expressions occur in arbitrarily nested for-loops. Thus, they are rooted in multiple sequences of context nodes (one per iteration). Consequently, the previously proposed algorithms need to be applied repeatedly, requiring multiple scans over the XML document encoding.In this work, we present loop-lifted staircase join, an extension of the staircase join that allows to efficiently evaluate XPath sub-expressions in arbitrarily nested XQuery iteration scopes with only a single scan over the document. We implemented the loop-lifted staircase join in MonetDB/XQuery, that uses the XQuery-to-Relational Algebra compiler Pathfinder on top of the extensible RDBMS MonetDB. Performance results indicate that the proposed technique allows to build a system that is capable of efficiently evaluating XQuery queries including embedded XPath expressions, obtaining interactive query execution times for all XMark queries even on multi-gigabyte XML documents