Intermediate Structure Reduction Algorithms for Stack Based Query Languages

  • Marta Burzańska
  • Krzysztof Stencel
  • Piotr Wiśniewski
Part of the Communications in Computer and Information Science book series (CCIS, volume 117)


Data processing often results in generation of a lot of temporary structures. They cause an increase in processing time and resources consumption. This especially concerns databases since their temporary data are huge and often they must be dumped to secondary storage. This situation has a serious impact on the query engine. An interesting technique of program fusion has been proposed for functional programming languages. Its goal is to reduce the size or entirely eliminate intermediate structures. In this paper we show how this technique can be used to generate robust execution plans of aggregate and recursive queries of query languages based on Stack Based Approach. We will use SBQL as an exemplary language.


Intermediate structures optimization rewriting algorithms SBQL program fusion 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theor. Comput. Sci. 73(2), 231–248 (1990)MathSciNetCrossRefMATHGoogle Scholar
  2. 2.
    Gill, A.J., Launchbury, J., Jones, S.L.P.: A short cut to deforestation. In: FPCA, pp. 223–232 (1993)Google Scholar
  3. 3.
    Johann, P.: Short cut fusion: Proved and improved. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 47–71. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  4. 4.
    Jones, S.P., Tolmach, A., Hoare, T.: Playing by the rules: rewriting as a practical optimisation technique in GHC. In: Haskell Workshop, ACM SIGPLAN, pp. 203–233 (2001)Google Scholar
  5. 5.
    Grust, T., Scholl, M.H.: Query deforestation. Technical report, Faculty of Mathematics and Computer Science, Database Research Group, University of Konstanz (1998)Google Scholar
  6. 6.
    Trigoni, A.: Semantic optimization of OQL queries. Technical Report UCAM-CL-TR-547, University of Cambridge, Computer Laboratory (2002)Google Scholar
  7. 7.
    Subieta, K.: Theory and Construction of Object Query Languages [in Polish]. Publishers of the Polish-Japanese Institute of Information Technology (2004)Google Scholar
  8. 8.
    Gill, A.: Cheap deforestation for non-strict functional languages. PhD thesis, The University of Glasgow (1996)Google Scholar
  9. 9.
    Subieta, K., Beeri, C., Matthes, F., Schmidt, J.W.: A stack-based approach to query languages. In: East/West Database Workshop, pp. 159–180 (1994)Google Scholar
  10. 10.
    OMG Object Database Technology Working Group: Next-generation object database standarization. White Paper (2007)Google Scholar
  11. 11.
    Rogińska, M., Wiśniewski, P.: Pysbql - python-like query language constructed using stack base approach. In: Annales UMCS, Informatica, pp. 143–151 (2007)Google Scholar
  12. 12.
    Płodzień, J.: Optimization Methods in Object Query Languages. PhD thesis, Institute of Computer Science, Polish Academy of Science, Warsaw, Poland (2000)Google Scholar
  13. 13.
    Pieciukiewicz, T., Stencel, K., Subieta, K.: Recursive Query Processing in SBQL. In: Proceedings of the First International Conference on Object Databases, pp. 56–76 (2008)Google Scholar
  14. 14.
    Ohori, A., Sasano, I.: Lightweight fusion by fixed point promotion. In: Hofmann, M., Felleisen, M. (eds.) POPL, pp. 143–154. ACM, New York (2007)Google Scholar
  15. 15.
    Stencel, K., et al.: LoXiM database project (2010),

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Marta Burzańska
    • 1
  • Krzysztof Stencel
    • 1
    • 2
  • Piotr Wiśniewski
    • 1
  1. 1.Faculty of Mathematics and Computer ScienceNicolaus Copernicus UniversityToruńPoland
  2. 2.Institute of InformaticsUniversity of WarsawWarsawPoland

Personalised recommendations