SQL query optimization: reordering for a general class of queries

  • Authors:
  • Piyush Goel;Bala Iyer

  • Affiliations:
  • IBM Santa Teresa Laboratory;IBM Santa Teresa Laboratory

  • Venue:
  • SIGMOD '96 Proceedings of the 1996 ACM SIGMOD international conference on Management of data
  • Year:
  • 1996

Quantified Score

Hi-index 0.00

Visualization

Abstract

The strength of commercial query optimizers like DB2 comes from their ability to select an optimal order by generating all equivalent reorderings of binary operators. However, there are no known methods to generate all equivalent reorderings for a SQL query containing joins, outer joins, and groupby aggregations. Consequently, some of the reorderings with significantly lower cost may be missed. Using hypergraph model and a set of novel identities, we propose a method to reorder a SQL query containing joins, outer joins, and groupby aggregations. While these operators are sufficient to capture the SQL semantics, it is during their reordering that we identify a powerful primitive needed for a dbms. We report our findings of a simple, yet fundamental operator, generalized selection, and demonstrate its power to solve the problem of reordering of SQL queries containing joins, outer joins, and groupby aggregations.