Skip to main content

2015 | OriginalPaper | Buchkapitel

SAM: A Sorting Approach for Optimizing Multijoin Queries

verfasst von : Yong Zeng, Amy Nan Lu, Lu Xia, Chris Xing Tian, Y. C. Tay

Erschienen in: Database and Expert Systems Applications

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Finding the optimal join order for a multijoin query is an old, yet very important topic for relational database systems. It has been studied for the last few decades and proven to be NP-hard. The mainstream techniques, first proposed in System R, are based on dynamic programming. These techniques are widely adopted by commercial database systems.
However, it is well known that such approaches suffer from exponential running time in finding the optimal join order for most queries, except simple ones like linear queries. Therefore, a query optimizer must resort to finding a suboptimal join order when the number of tables is large.
This paper proposes SAM, which departs from current practice in two ways: (1) SAM orders the joining attributes before ordering the tables; (2) SAM sorts the tables by comparing selectivities for “table blocks”. This approach reduces the exponential time complexity in the optimization; in particular, it can find, in polynomial time, the optimal ordering for clique queries that take exponential time to optimize by dynamic programming.
Experiments comparing SAM to the query optimizers in MySQL and PostgreSQL, using real data, show that its performance is similar for small queries, but much better for large queries.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literatur
1.
Zurück zum Zitat Bao, Z., Tay, Y.C., Zhou, J.: sonSchema: a conceptual schema for social networks. In: Ng, W., Storey, V.C., Trujillo, J.C. (eds.) ER 2013. LNCS, vol. 8217, pp. 197–211. Springer, Heidelberg (2013) CrossRef Bao, Z., Tay, Y.C., Zhou, J.: sonSchema: a conceptual schema for social networks. In: Ng, W., Storey, V.C., Trujillo, J.C. (eds.) ER 2013. LNCS, vol. 8217, pp. 197–211. Springer, Heidelberg (2013) CrossRef
2.
Zurück zum Zitat DeHaan, D., Tompa, F.W.: Optimal top-down join enumeration. In: Proceedings of the SIGMOD, pp. 785–796 (2007) DeHaan, D., Tompa, F.W.: Optimal top-down join enumeration. In: Proceedings of the SIGMOD, pp. 785–796 (2007)
3.
Zurück zum Zitat Fegaras, L.: A new heuristic for optimizing large queries. In: Quirchmayr, G., Bench-Capon, T.J.M., Schweighofer, E. (eds.) DEXA 1998. LNCS, vol. 1460, pp. 726–735. Springer, Heidelberg (1998) CrossRef Fegaras, L.: A new heuristic for optimizing large queries. In: Quirchmayr, G., Bench-Capon, T.J.M., Schweighofer, E. (eds.) DEXA 1998. LNCS, vol. 1460, pp. 726–735. Springer, Heidelberg (1998) CrossRef
4.
Zurück zum Zitat Ibaraki, T., Kameda, T.: On the optimal nesting order for computing n-relational joins. ACM Trans. Database Syst. 9(3), 482–502 (1984)MathSciNetCrossRef Ibaraki, T., Kameda, T.: On the optimal nesting order for computing n-relational joins. ACM Trans. Database Syst. 9(3), 482–502 (1984)MathSciNetCrossRef
5.
Zurück zum Zitat Kossmann, D., Stocker, K.: Iterative dynamic programming: a new class of query optimization algorithms. ACM Trans. Database Syst. 25(1), 43–82 (2000)CrossRef Kossmann, D., Stocker, K.: Iterative dynamic programming: a new class of query optimization algorithms. ACM Trans. Database Syst. 25(1), 43–82 (2000)CrossRef
6.
Zurück zum Zitat Lee, C., Shih, C.-S., Chen, Y.-H.: Optimizing large join queries using a graph-based approach. IEEE Trans. Knowl. Data Eng. 13(2), 298–315 (2001)CrossRef Lee, C., Shih, C.-S., Chen, Y.-H.: Optimizing large join queries using a graph-based approach. IEEE Trans. Knowl. Data Eng. 13(2), 298–315 (2001)CrossRef
7.
Zurück zum Zitat Moerkotte, G., Neumann, T.: Analysis of two existing and one new dynamic programming algorithm for the generation of optimal bushy join trees without cross products. In: Proceedings of the VLDB, pp. 930–941 (2006) Moerkotte, G., Neumann, T.: Analysis of two existing and one new dynamic programming algorithm for the generation of optimal bushy join trees without cross products. In: Proceedings of the VLDB, pp. 930–941 (2006)
8.
Zurück zum Zitat Moerkotte, G., Neumann, T.: Dynamic programming strikes back. In: Proceedings of the SIGMOD, pp. 539–552 (2008) Moerkotte, G., Neumann, T.: Dynamic programming strikes back. In: Proceedings of the SIGMOD, pp. 539–552 (2008)
9.
Zurück zum Zitat Neumann, T.: Query simplification: graceful degradation for join-order optimization. In: Proceedings of the SIGMOD, pp. 403–414 (2009) Neumann, T.: Query simplification: graceful degradation for join-order optimization. In: Proceedings of the SIGMOD, pp. 403–414 (2009)
10.
Zurück zum Zitat Ngo, H.Q., Porat, E., Ré, C., Rudra, A.: Worst-case optimal join algorithms: [extended abstract]. In: Proceedings of the PODS, pp. 37–48 (2012) Ngo, H.Q., Porat, E., Ré, C., Rudra, A.: Worst-case optimal join algorithms: [extended abstract]. In: Proceedings of the PODS, pp. 37–48 (2012)
11.
Zurück zum Zitat Sacco, G.M.: Truly adaptive optimization: the basic ideas. In: Bressan, S., Küng, J., Wagner, R. (eds.) DEXA 2006. LNCS, vol. 4080, pp. 751–760. Springer, Heidelberg (2006) CrossRef Sacco, G.M.: Truly adaptive optimization: the basic ideas. In: Bressan, S., Küng, J., Wagner, R. (eds.) DEXA 2006. LNCS, vol. 4080, pp. 751–760. Springer, Heidelberg (2006) CrossRef
12.
Zurück zum Zitat Selinger, P.G., Astrahan, M.M., Chamberlin, D.D., et al.: Access path selection in a relational database management system. In: Proceedings of the SIGMOD, pp. 23–34 (1979) Selinger, P.G., Astrahan, M.M., Chamberlin, D.D., et al.: Access path selection in a relational database management system. In: Proceedings of the SIGMOD, pp. 23–34 (1979)
13.
Zurück zum Zitat Steinbrunn, M., Moerkotte, G., Kemper, A.: Heuristic and randomized optimization for the join ordering problem. VLDB J. 6(3), 191–208 (1997)CrossRefMATH Steinbrunn, M., Moerkotte, G., Kemper, A.: Heuristic and randomized optimization for the join ordering problem. VLDB J. 6(3), 191–208 (1997)CrossRefMATH
14.
Zurück zum Zitat Swami, A., Gupta, A.: Optimization of large join queries. In: Proceedings of the SIGMOD, pp. 8–17 (1988) Swami, A., Gupta, A.: Optimization of large join queries. In: Proceedings of the SIGMOD, pp. 8–17 (1988)
15.
Zurück zum Zitat Vance, B., Maier, D.: Rapid bushy join-order optimization with cartesian products. In: Proceedings of the SIGMOD, pp. 35–46 (1996) Vance, B., Maier, D.: Rapid bushy join-order optimization with cartesian products. In: Proceedings of the SIGMOD, pp. 35–46 (1996)
Metadaten
Titel
SAM: A Sorting Approach for Optimizing Multijoin Queries
verfasst von
Yong Zeng
Amy Nan Lu
Lu Xia
Chris Xing Tian
Y. C. Tay
Copyright-Jahr
2015
DOI
https://doi.org/10.1007/978-3-319-22849-5_25