Efficient Holistic Twig Joins in Leaf-to-Root Combining with Root-to-Leaf Way

  • Guoliang Li
  • Jianhua Feng
  • Yong Zhang
  • Lizhu Zhou
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4443)


Finding all the occurrences of a twig pattern on multiple elements in an XML document is a core operation for efficient evaluation of XML queries. Holistic twig join algorithms, TwigStack and TSGeneric, have been recognized as optimal solutions when the twig pattern only involves A-D(ancestor-descendant) relationships, while iTwigJoin can be optimal for partial twig patterns that contain A-D only or P-C (parent-child) only relationships. However, existing algorithms involve unnecessary computations and CPU cost of them can be further improved, and we in this paper mainly address this problem. We first propose three effective optimization rules to avoid those unnecessary computations, and then present two algorithms incorporated with these optimization rules to effectively answer twig patterns in leaf-to-root combining with root-to-leaf way. Experimental results on various datasets indicate that our algorithms perform significantly better than existing proposals.


Partial Solution Improve Ratio Query Node Solution Extension Potential Element 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [AJK+02]
    Al-Khalifa, S., Jagadish, H.V., Koudas, N., Patel, J.M., Srivastava, D., Wu, Y.: Structural Joins: A Primitive for Efficient XML Query Pattern Matching. In: ICDE, pp. 141–152 (2002)Google Scholar
  2. [BBC+02]
    Berglund, A., Boag, S., Chamberlin, D., et al.: XML path language 2.0. Technical report, W3C (2002)Google Scholar
  3. [BCF+02]
    Boag, S., Chamberlin, D., Fernandez, M., et al.: XQuery 1.0: An XML query language. W3C (2002)Google Scholar
  4. [BKS02]
    Bruno, N., Koudas, N., et al.: Holistic Twig Joins: Optimal XML Pattern Matching. In: SIGMOD (2002)Google Scholar
  5. [CLC04]
    Chen, T., Ling, T.-W., Chan, C.-Y.: Prefix Path Streaming: A New Clustering Method for Optimal Holistic XML Twig Pattern Matching. In: Galindo, F., Takizawa, M., Traunmüller, R. (eds.) DEXA 2004. LNCS, vol. 3180, pp. 801–810. Springer, Heidelberg (2004)Google Scholar
  6. [CLL05]
    Chen, T., Lu, J., Ling, T.W.: On Boosting Holism In XML Twig Pattern Matching Using Structural Indexing Techniques. In: SIGMOD (2005)Google Scholar
  7. [CLT+06]
    Chen, S., Li, H.-G., Tatemura, J., Hsiung, W.-P., Agrawal, D., Candan, K.: Twig2Stack: Bottom-up Processing of Generalized-Tree-Pattern Queries over XML Documents. In: VLDB, pp. 283–294 (2006)Google Scholar
  8. [CMW03]
    Choi, B., Mahoui, M., Wood, D.: On the Optimality of Holistic Algorithms for Twig Queries. In: Mařík, V., Štěpánková, O., Retschitzegger, W. (eds.) DEXA 2003. LNCS, vol. 2736, pp. 28–37. Springer, Heidelberg (2003)Google Scholar
  9. [CVZ+02]
    Chien, S.-Y., Vagena, Z., et al.: Efficient Structural Joins on Indexed XML Documents. In: VLDB (2002)Google Scholar
  10. [FK99]
    Florescu, D., Kossmann, D.: Storing and querying XML data using an RDBMS. In: IEEE Data Eng. (1999)Google Scholar
  11. [G02]
    Grust, T.: Accelerating XPath Location Steps. In: SIGMOD, pp. 109–120 (2002)Google Scholar
  12. [JLWO03]
    Jiang, H.F., Lu, H.J., et al.: XR-Tree:Indexing XML Data for Efficient Structural Joins. In: ICDE (2003)Google Scholar
  13. [JWL+03]
    Jiang, H.F., Wang, W., Lu, H.J., et al.: Holistic Twig Joins on Indexed XML Documents. In: VLDB (2003)Google Scholar
  14. [JLW04]
    Jiang, H.F., Lu, H.J., et al.: Efficient Processing of Twig Queries with OR-Predicates. In: SIGMOD (2004)Google Scholar
  15. [LCL04]
    Lu, J., Chen, T., Ling, T.W.: Efficient Processing of XML Twig Patterns with Parent Child Edges: A Look-ahead Approach. In: CIKM, pp. 533–542 (2004)Google Scholar
  16. [LLC+05]
    Lu, J., Ling, T.W., Chan, C.-Y., Chen, T.: From Region Encoding To Extended Dewey: On Efficient Processing of XML Twig Pattern Matching. In: VLDB, pp. 193–204 (2005)Google Scholar
  17. [LM01]
    Li, Q., Moon, B.: Indexing and Quering XML Data for Regular Path Expressions. In: VLDB (2001)Google Scholar
  18. [MHH06]
    Mathis, C., Härder, T., Haustein, M.: Locking-Aware Structural Join Operators for XML Query Processing. In: SIGMOD (2006)Google Scholar
  19. [STZ+99]
    Shanmugasundaram, J., Tufte, K., Zhang, C., Gang, H., DeWitt, D.J., Naughton, J.F.: Relational databases for querying XML documents: Limitations and opportunities. In: VLDB, pp. 302–314 (1999)Google Scholar
  20. [TVB+02]
    Tatarinov, I., Viglas, S., Beyer, K., Shanmugasundaram, J., Shekita, E., Zhang, C.: Storing and querying ordered XML using a relational database system. In: SIGMOD, pp. 204–215 (2002)Google Scholar
  21. [WPJ03]
    Wu, Y., Patel, J., Jagadish, H.: Structural join order selection for XML query optimization. In: ICDE (2003)Google Scholar
  22. [ZND+01]
    Zhang, C., Naughton, J.F., DeWitt, D.J., Luo, Q., Lohman, G.M.: On Supporting Containment Queries in Relational Database Management Systems. In: SIGMOD, pp. 425–436 (2001)Google Scholar
  23. [TreeBank]
    University of Washington XML Repository,
  24. [XMark]

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Guoliang Li
    • 1
  • Jianhua Feng
    • 1
  • Yong Zhang
    • 1
  • Lizhu Zhou
    • 1
  1. 1.Department of Computer Science and Technology, Tsinghua University, Beijing 100084China

Personalised recommendations