An Optimization Method for XML Twig Query

XML tree pattern query, also known as Twig query, is the core operation in XML query processing. In the research of the Twig query algorithm, TreeMatch is considered to be one of the best algorithms because it reduces the generation of intermediate results. However, in the core operation getNext of the TreeMatch algorithm, there are many calculations that depend only on Twig mode. This redundant duplicate calculation affects the performance of the TreeMatch algorithm when there are many getNext calls. In order to further improve the algorithm, this paper proposes a Twig query optimization method based on partial evaluation and hot-trace compilation. This method takes Twig mode as an invariant to perform partial evaluation and translates query requests into a Twig query machine instruction sequence. The duplication calculation of the Twig pattern during the query process is avoided, and the process of interpretation of the instruction sequence of the query machine is optimized by using the hot trace compilation technique. The comparison experiment shows that the optimization method based on partial evaluation and hot-trace compilation can increase the efficiency of twig query by 20% to 60%.

[1]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[2]  Saman Amarasinghe,et al.  Dynamic native optimization of interpreters , 2003, IVME '03.

[3]  Neil D. Jones,et al.  An introduction to partial evaluation , 1996, CSUR.

[4]  Vasanth Bala,et al.  Dynamo: a transparent dynamic optimization system , 2000, SIGP.

[5]  Michael Franz,et al.  HotpathVM: an effective JIT compiler for resource-constrained devices , 2006, VEE '06.

[6]  Sven-Bodo Scholz Partial evaluation as universal compiler tool: experiences from the SAC Eco system , 2014, PEPM '14.

[7]  Joeri De Koster,et al.  A formal foundation for trace-based JIT compilers , 2015, WODA@SPLASH.

[8]  Anders Bondorf,et al.  Improving binding times without explicit CPS-conversion , 1992, LFP '92.

[9]  Mohand Boughanem,et al.  A survey on tree matching and XML retrieval , 2013, Comput. Sci. Rev..

[10]  Liao Hu-sheng The Research and Implementation of Partial Evaluation for XQuery , 2009 .

[11]  Nikolai Tillmann,et al.  SPUR: a trace-based JIT compiler for CIL , 2010, OOPSLA.

[12]  Toshio Nakatani,et al.  Adaptive multi-level compilation in a trace-based Java JIT compiler , 2012, OOPSLA '12.

[13]  Divesh Srivastava,et al.  Holistic twig joins: optimal XML pattern matching , 2002, SIGMOD '02.

[14]  Jeffrey Xu Yu,et al.  TwigList : Make Twig Pattern Matching Fast , 2007, DASFAA.

[15]  Chen Wang,et al.  Extended XML Tree Pattern Matching: Theories and Algorithms , 2011, IEEE Transactions on Knowledge and Data Engineering.

[16]  Michael Leuschel,et al.  Allocation removal by partial evaluation in a tracing JIT , 2011, PEPM '11.