DDO-Free XQuery

XQuery has an order-sensitive semantics in the sense that it requires nodes to be sorted in document order without duplicates (or in Distinct Document Order, DDO for short). This paper shows that for a given XQuery expression and a nested-relational DTD, the input expression can be transformed into an expression that can be evaluated without---potentially costly---ordering operations even if the input query requires its result to be in DDO. To this end, we propose an XQuery transformation algorithm that consists of simple rewriting rules. The basic idea is inspired by a generate-and-test approach as commonly used for solving search problems. We apply this approach when constructing the transformed expression: first, a skeleton query is prepared for the generate phase. This skeleton query can be evaluated without DDO, but it has the ability to return all nodes in DDO for all XML documents that conform to the input DTD. Second, an output expression is generated by injecting conditions for the test phase, which are extracted from the input expression, into the skeleton query. The key to performing both the extraction and injection of conditions in a systematic way is to utilize XQuery transformations that preserve equivalence up to DDO.

[1]  Torsten Grust,et al.  Staircase Join: Teach a Relational DBMS to Watch its (Axis) Steps , 2003, VLDB.

[2]  Chun Zhang,et al.  Storing and querying ordered XML using a relational database system , 2002, SIGMOD '02.

[3]  Z. Hu,et al.  Context-preserving XQuery fusion , 2015, Math. Struct. Comput. Sci..

[4]  Talel Abdessalem,et al.  Pruning nested XQuery queries , 2008, CIKM '08.

[5]  Giuseppe Castagna,et al.  A Core Calculus for XQuery 3.0 - Combining Navigational and Pattern Matching Approaches , 2015, ESOP.

[6]  Torsten Grust,et al.  MonetDB/XQuery: a fast XQuery processor powered by a relational engine , 2006, SIGMOD Conference.

[7]  Philip Wadler,et al.  A Semi-monad for Semi-structured Data , 2001, ICDT.

[8]  M. Tamer Özsu,et al.  A comprehensive XQuery to SQL translation using dynamic interval encoding , 2003, SIGMOD '03.

[9]  Nils Gesbert,et al.  XQuery and static typing: tackling the problem of backward axes , 2015, ICFP.

[10]  Marcel Waldvogel,et al.  Pushing XPath Accelerator to its Limits , 2006, ExpDB.

[11]  Matthias Nicola,et al.  On the path to efficient XML queries , 2006, VLDB.

[12]  Ling Liu,et al.  Encyclopedia of Database Systems , 2009, Encyclopedia of Database Systems.

[13]  Torsten. Grust,et al.  Accelerating XPath location steps , 2002, SIGMOD '02.

[14]  Gagan Agrawal,et al.  Efficient Evaluation of XQuery over Streaming Data , 2005, VLDB.

[15]  Philippe Michiels,et al.  Optimizing Sorting and Duplicate Elimination in XQuery Path Expressions , 2005, Bull. EATCS.

[16]  Christoph Koch,et al.  On the complexity of nonrecursive XQuery and functional query languages on complex values , 2006, TODS.

[17]  Marcus Fontoura,et al.  Querying XML streams , 2005, The VLDB Journal.

[18]  Marcelo Arenas,et al.  Relational and XML Data Exchange , 2010, Relational and XML Data Exchange.

[19]  Torsten Grust,et al.  eXrQuy: Order Indifference in XQuery , 2007, 2007 IEEE 23rd International Conference on Data Engineering.

[20]  Jan Hidders,et al.  Avoiding Unnecessary Ordering Operations in XPath , 2003, DBPL.