Skip to main content

Uniformly-distributed random generation of join orders

  • Contributed Papers
  • Conference paper
  • First Online:
Database Theory — ICDT '95 (ICDT 1995)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 893))

Included in the following conference series:

Abstract

In this paper we study the space of operator trees that can be used to answer a join query, with the goal of generating elements form this space at random. We solve the problem for queries with acyclic query graphs. We first count, in O(n 3) time, the exact number of trees that can be used to evaluate a given query on n relations. The intermediate results of the counting procedure then serve to generate random, uniformly distributed operator trees in O(n 2) time per tree. We also establish a mapping between the N operator trees for a query and the integers 1 through N —i. e. a ranking-and describe ranking and unranking procedures with complexity O(n 2) and O(n 2 log n), respectively.

C. Galindo-Legaria was supported by an ERCIM postdoctoral fellowship.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. C. Beeri, R. Fagin, D. Maier, and M. Yannakakis. On the desirability of acyclic database schemes. Journal of the ACM, 30(3):479–513, July 1983.

    Google Scholar 

  2. S. Ceri and G. Pelagatti. Distributed Databases: Principles and Systems. McGraw-Hill, New York, 1985.

    Google Scholar 

  3. C. A. Galindo-Legaria, A. Pellenkoft, and M. L. Kersten. Fast, randomized join-order selection —Why use transformations? In Proceedings of the Twentieth International Conference on Very Large Databases, Santiago, 1994. Also CWI Technical Report CS-R9416.

    Google Scholar 

  4. U. Gupta, D. T. Lee, and C. K. Wong. Ranking and unranking of 2–3 trees. SIAM Journal of Computation, pages 582–590, August 1982.

    Google Scholar 

  5. G. Graefe. Query evaluation techniques for large databases. ACM Computing Surveys, 25(2):73–170, June 1993.

    Google Scholar 

  6. F. Harary and E. M. Palmer. Graphical Enumeration. Academic Press, 1973.

    Google Scholar 

  7. Y. E. Ioannidis and Y. C. Kang. Randomized algorithms for optimizing large join queries. Proc. of the ACM-SIGMOD Conference on Management of Data, pages 312–321, 1990.

    Google Scholar 

  8. Y. E. Ioannidis and Y. C. Kang. Left-deep vs. bushy trees: An analysis of strategy spaces and its implications for query optimization. Proc. of the ACM-SIGMOD Conference on Management of Data, pages 168–177, 1991.

    Google Scholar 

  9. Y. C. Kang. Randomized Algorithms for Query Optimization. PhD thesis, University of Wisconsin-Madison, 1991. Technical report #1053.

    Google Scholar 

  10. D. E. Knuth. The Art of Computer Programming, volume 1: Fundamental Algorithms. Addison-Wesley, 1968. Second edition, 1973.

    Google Scholar 

  11. W. Kim, D. S. Reiner, and D. S. Batory, editors. Query processing in database systems. Springer, Berlin, 1985.

    Google Scholar 

  12. R. S. G. Lanzelotte, P. Valduriez, and M. Zaït. On the effectiveness of optimization search strategies for parallel execution spaces. Proc. of the 19th VLDB Conference, Dublin, Ireland, pages 493–504, 1993.

    Google Scholar 

  13. K. Ono and G. M. Lohman. Measuring the complexity of join enumeration in query optimization. Proc. of the 16th VLDB Conference, Brisbane, Australia, pages 314–325, 1990.

    Google Scholar 

  14. F. Ruskey and T. C. Hu. Generating binary trees lexicographically. SIAM journal of Computation, 6(4):745–758, December 1977.

    Google Scholar 

  15. A. N. Swami and A. Gupta. Optimization of large join queries. Proc. of the ACM-SIGMOD Conference on Management of Data, pages 8–17, 1988.

    Google Scholar 

  16. A. N. Swami. Optimization of Large Join Queries. PhD thesis, Stanford University, 1989. Technical report STAN-CS-89-1262.

    Google Scholar 

  17. A. N. Swami. Optimization of large join queries: Combining heuristics and combinatorial techniques. Proc. of the ACM-SIGMOD Conference on Management of Data, pages 367–376, 1989.

    Google Scholar 

  18. A. N. Swami. Distribution of query plan costs for large join queries. Technical Report RJ 7908, IBM Research Division, Almaden, 1991.

    Google Scholar 

  19. J. D. Ullman. Principles of Database Systems. Computer Science Press, Rockville, MD, 2nd edition, 1982.

    Google Scholar 

  20. J. S. Vitter and Ph. Flajolet. Analysis of algorithms and data structures. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume A: Algorithms and Complexity, chapter 9, pages 431–524. North Holland, 1990.

    Google Scholar 

  21. J. van Leeuwen. Graph algorithms. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume A: Algorithms and Complexity, chapter 10, pages 525–631. North Holland, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Georg Gottlob Moshe Y. Vardi

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Galindo-Legaria, C.A., Pellenkoft, A., Kersten, M.L. (1995). Uniformly-distributed random generation of join orders. In: Gottlob, G., Vardi, M.Y. (eds) Database Theory — ICDT '95. ICDT 1995. Lecture Notes in Computer Science, vol 893. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58907-4_22

Download citation

  • DOI: https://doi.org/10.1007/3-540-58907-4_22

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-58907-5

  • Online ISBN: 978-3-540-49136-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics