Advertisement

Towards Algebraic Query Optimisation for XQuery

  • Markus Kirchberg
  • Faizal Riaz-ud-Din
  • Klaus-Dieter Schewe
  • Alexei Tretiakov
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4244)

Abstract

XML-based databases have become a major area of interest in database research. Abstractly speaking they can be considered as a resurrection of complex-value databases using constructors for records, lists, unions plus optionality and references. XQuery has become the standard query language for XML. As XQuery is a declarative query language, the problem of query optimisation arises. In this paper an algebraic approach to query optimisation is introduced. This is based on a translation of XQuery into a query algebra for rational tree types. The algebra uses simple operations on types and structural recursion for lists. The translation exploits linguistic reflection for the type-safe expansion of path expressions. The availability of an algebraic representation of queries permits query rewriting, which in combination with cost heuristics permits queries to be rewritten and thus optimised.

Keywords

Query Language Query Optimisation Optimisation Rule Structural Recursion Path Expression 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abiteboul, S., Buneman, P., Suciu, D.: Data on the Web: From Relations to Semistructured Data and XML. Morgan Kaufmann Publishers, San Francisco (2000)Google Scholar
  2. 2.
    Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Reading (1995)MATHGoogle Scholar
  3. 3.
    Abiteboul, S., Kanellakis, P.C.: Object identity as a query language primitive. In: Bancilhon, F., Delobel, C., Kanellakis, P.C. (eds.) Building an Object-Oriented Database System, The Story of O2, pp. 97–127. Morgan Kaufmann, San Francisco (1992)Google Scholar
  4. 4.
    Abiteboul, S., Quass, D., McHugh, J., Widom, J., Wiener, J.: The LOREL query language for semi-structured data. International Journal on Digital Libraries 1(1), 68–88 (1997)CrossRefGoogle Scholar
  5. 5.
    Beeri, C., Ta-Shma, P.: Bulk data types, a theoretical approach. In: Database Programming Languages (DBPL-4). Workshops in Computing, pp. 80–96. Springer, Heidelberg (1993)Google Scholar
  6. 6.
    Buneman, P., Davidson, S., Hillebrand, G., Suciu, D.: A query language and optimization techniques for unstructured data. In: Proceedings of the International Conference on Management of Data, pp. 505–516. ACM Press, New York (1996)Google Scholar
  7. 7.
    Chen, Y., Davidson, S.B., Zheng, Y.: BLAS: An efficient XPath processing system. In: Weikum, G., König, A.C., Deßloch, S. (eds.) Proceedings of the Symposium on Principles of Database Systems, pp. 47–58. ACM Press, New York (2004)Google Scholar
  8. 8.
    Cluet, S., Delobel, C., Lécluse, C., Richard, P.: RELOOP: An algebra-based query language for O2. In: Bancilhon, F., Delobel, C., Kanellakis, P. (eds.) Building an Object-Oriented Database System – The Story of O2. Morgan Kaufmann, San Francisco (1992)Google Scholar
  9. 9.
    Cluet, S., Moerkotte, G.: Nested queries in object bases. In: Beeri, C., Ohori, A., Shasha, D. (eds.) Database Programming Languages (DBPL-4). Workshops in Computing, pp. 226–242. Springer, Heidelberg (1993)Google Scholar
  10. 10.
    Courcelle, B.: Fundamental properties of infinite trees. Theoretical Computer Science 25, 95–169 (1983)MATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    DeHaan, D., Toman, D., Consens, M.P., Özsu, M.T.: A comprehensive XQuery to SQL translation using dynamic interval encoding. In: Halevy, A.Y., Ives, Z.G., Doan, A. (eds.) Proceedings of the Symposium on Principles of Database Systems, pp. 623–634. ACM Press, New York (2003)Google Scholar
  12. 12.
    Deutsch, A., Fernandez, M., Florescu, D., Levy, A., Suciu, D.: A query language for XML. Computer Networks 31, 11–16, 1155–1169 (1999)Google Scholar
  13. 13.
    Fernandez, M.F., Siméon, J., Wadler, P.: An algebra for XML query. In: Proceedings of the 20th Conference on Foundations of Software Technology and Theoretical Computer Science, pp. 11–45. Springer, Heidelberg (2000)Google Scholar
  14. 14.
    Gottlob, G., Koch, C., Pichler, R.: The complexity XPath query evaluation. In: Proceedings of the 22nd Symposium on Principles of Database Systems, pp. 179–190. ACM Press, New York (2003)Google Scholar
  15. 15.
    Jagadish, H.V., Lakshmanan, L.V.S., Srivastava, D., Thompson, K.: TAX: A tree algebra for XML. In: Revised Papers from the 8th International Workshop on Database Programming Languages, pp. 149–164. Springer, Heidelberg (2002)Google Scholar
  16. 16.
    Katz, H. (ed.): XQuery from the Experts – A Guide to the W3C XML Query Language. Addison-Wesley, Reading (2003)Google Scholar
  17. 17.
    Kemper, A., Moerkotte, G.: Query optimization in object bases: Exploiting relational techniques. In: Freytag, J.-C., Maier, D., Vossen, G. (eds.) Proceedings of the Dagstuhl Workshop on Query Optimization. Morgan Kaufmann, San Francisco (1993)Google Scholar
  18. 18.
    Kirby, G.N.C., Connor, R.C.H., Morrison, R.: START: A linguistic reflection tool using hyper-program technology. In: Atkinson, M.P., Maier, D., Benzaken, V. (eds.) Proceedings of the Sixth International Workshop on Persistent Object Systems. Workshops in Computing, pp. 355–373. Springer, Heidelberg (1994)Google Scholar
  19. 19.
    Kirchberg, M., Ma, H., ud Din, F.R., Schewe, K.-D.: A unified approach to object algebras. unpublished, available from the authors (2003)Google Scholar
  20. 20.
    Kirchberg, M., Riaz-ud-Din, F., Schewe, K.-D., Tretiakov, A.: Using reflection for querying XML documents. In: Bailey, J., Dobbie, G. (eds.) Database Technologies 2006. Proceedings of the 17th Australasian Database Conference (ADC). CRPIT, vol. 49, pp. 119–128. Australian Computer Society (2006)Google Scholar
  21. 21.
    Kirchberg, M., Schewe, K.-D., Tretiakov, A.: A multi-level architecture for distributed object bases. In: Camp, O., Filipe, J., Hammoudi, S., Piattini, M. (eds.) Proceedings of the 5th International Conference on Enterprise Information Systems (ICEIS), vol. 1, pp. 63–70. ICEIS Press (2003)Google Scholar
  22. 22.
    Kirchberg, M., Schewe, K.-D., Tretiakov, A.: Using XML to support media types. In: Kaschek, R., Mayr, H.C., Liddle, S.W. (eds.) 4th International Conference on Information Systems Technology and its Applications, GI. LNI, vol. 63, pp. 101–113 (2005)Google Scholar
  23. 23.
    Koch, C.: On the complexity of nonrecursive XQuery and functional query languages on complex values. In: Principles of Database Systems. ACM Press, New York (2005)Google Scholar
  24. 24.
    Leung, T.W., Mitchell, G., Subramanian, B., Vance, B., Vandenberg, S.L., Zdonik, S.B.: The AQUA data model and algebra. In: Beeri, C., Ohori, A., Shasha, D. (eds.) Database Programming Languages (DBPL-4). Workshops in Computing, pp. 157–175. Springer, Heidelberg (1993)Google Scholar
  25. 25.
    Libkin, L., Wong, L.: New techniques for studying set languages, bag languages and aggregate functions. In: Principles of Database Systems (PODS), pp. 155–166. ACM Press, New York (1994)Google Scholar
  26. 26.
    Lobin, H.: Informationsmodellierung in XML und SGML. Springer, Heidelberg (2001)MATHGoogle Scholar
  27. 27.
    Marx, M.: Conditional XPath, the first order complete XPath dialect. In: Proceedings of the 23rd Symposium on Principles of Database Systems (PoDS), pp. 13–22. ACM Press, New York (2004)Google Scholar
  28. 28.
    Paparizos, S., Wu, Y., Lakshmanan, L.V.S., Jagadish, H.V.: Tree logical classes for efficient evaluation of XQuery. In: Weikum, G., König, A.C., Deßloch, S. (eds.) Proceedings of the Symposium on Principles of Database Systems (SIGMOD), pp. 71–82. ACM, New York (2004)Google Scholar
  29. 29.
    Savnik, I., Tari, Z., Mohoric, T.: QAL: A query algebra of complex objects. Data and Knowledge Engineering 30(1), 57–94 (1999)MATHCrossRefGoogle Scholar
  30. 30.
    Schewe, K.-D.: On the unification of query algebras and their extension to rational tree structures. In: Orlowska, M.E., Roddick, J.F. (eds.) Database Technologies – Proceedings of the 12th Australasian Database Conference (ADC), pp. 52–59. IEEE Computer Society, Los Alamitos (2001)CrossRefGoogle Scholar
  31. 31.
    Schewe, K.-D., Schmidt, J.W., Wetzel, I.: Identification, genericity and consistency in object-oriented databases. In: Hull, R., Biskup, J. (eds.) ICDT 1992. LNCS, vol. 646, pp. 341–356. Springer, Heidelberg (1992)Google Scholar
  32. 32.
    Schewe, K.-D., Thalheim, B.: Fundamental concepts of object oriented databases. Acta Cybernetica 11(4), 49–84 (1993)MATHMathSciNetGoogle Scholar
  33. 33.
    Shaw, G.M., Zdonik, S.B.: An object-oriented query algebra. In: Hull, R., Morrison, R., Stemple, D.W. (eds.) Proceedings of the Second International Workshop on Database Programming Languages, pp. 103–112. Morgan Kaufmann, San Francisco (1989)Google Scholar
  34. 34.
    Sheard, T., Fegaras, L.: A fold for all seasons. In: Conference on Functional Programming Languages and Computer Architecture, pp. 233–242. ACM Press, New York (1993)CrossRefGoogle Scholar
  35. 35.
    Sheard, T., Stemple, D.W.: Automatic verification of database transaction safety. ACM Transactions on Database Systems 14(3), 322–368 (1989)CrossRefGoogle Scholar
  36. 36.
    Siméon, J., Wadler, P.: The essence of XML. In: Proceedings of the 30th Symposium on Principles of Programming Languages (POPL). ACM Press, New York (2003)Google Scholar
  37. 37.
    Stemple, D.W., Fegaras, L., Sheard, T., Socorro, A.: Exceeding the limits of polymorphism in database programming languages. In: Bancilhon, F., Tsichritzis, D.C., Thanos, C. (eds.) EDBT 1990. LNCS, vol. 416, pp. 269–285. Springer, Heidelberg (1990)CrossRefGoogle Scholar
  38. 38.
    Stemple, D.W., Morrison, R., Atkinson, M.P.: Type-safe linguistic reflection. In: Kanellakis, P.C., Schmidt, J.W. (eds.) Database Programming Languages: Bulk Types and Persistent Data, pp. 357–360. Morgan Kaufmann, San Francisco (1991)Google Scholar
  39. 39.
    Stemple, D.W., Sheard, T.: A recursive base for database programming primitives. In: Stogny, A.A., Schmidt, J.W. (eds.) EWDW 1990. LNCS, vol. 504, pp. 311–332. Springer, Heidelberg (1991)Google Scholar
  40. 40.
    Suciu, D., Wong, L.: On two forms of structural recursion. In: Vardi, M.Y., Gottlob, G. (eds.) ICDT 1995. LNCS, vol. 893, pp. 111–124. Springer, Heidelberg (1995)Google Scholar
  41. 41.
    Tannen, V., Buneman, P., Wong, L.: Naturally embedded query languages. In: Hull, R., Biskup, J. (eds.) ICDT 1992. LNCS, vol. 646, pp. 140–154. Springer, Heidelberg (1992)Google Scholar
  42. 42.
    Tatarinov, I., Ives, Z., Halevy, A., Weld, D.: Updating XML. In: Proceedings of the International Conference on Management of Data, pp. 413–424. ACM, New York (2001)Google Scholar
  43. 43.
    Thalheim, B.: Entity-Relationship Modeling: Foundations of Database Technology. Springer, Heidelberg (2000)MATHGoogle Scholar
  44. 44.
    Wadler, P.: Comprehending monads. Mathematical Structures in Computer Science 2(4), 461–493 (1992)MATHCrossRefMathSciNetGoogle Scholar
  45. 45.
    Wong, L.: Normal forms and conservative properties for query languages over collection types. In: Principles of Database Systems (PODS), pp. 26–36. ACM Press, New York (1993)Google Scholar
  46. 46.
  47. 47.
    World Wide Web Consortium (W3C). XQuery (2004), http://www.w3c.org/TR/xquery

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Markus Kirchberg
    • 1
  • Faizal Riaz-ud-Din
    • 1
  • Klaus-Dieter Schewe
    • 1
  • Alexei Tretiakov
    • 1
  1. 1.Department of Information Systems and, Information Science Research CentreMassey UniversityPalmerston NorthNew Zealand

Personalised recommendations