On the optimal nesting order for computing N-relational joins

  • Authors:
  • Toshihide Ibaraki;Tiko Kameda

  • Affiliations:
  • Toyohashi Univ.;Simon Fraser Univ.

  • Venue:
  • ACM Transactions on Database Systems (TODS)
  • Year:
  • 1984

Quantified Score

Hi-index 0.01

Visualization

Abstract

Using the nested loops method, this paper addresses the problem of minimizing the number of page fetches necessary to evaluate a given query to a relational database. We first propose a data structure whereby the number of page fetches required for query evaluation is substantially reduced and then derive a formula for the expected number of page fetches. An optimal solution to our problem is the nesting order of relations in the evaluation program, which minimizes the number of page fetches. Since the minimization of the formula is NP-hard, as shown in the Appendix, we propose a heuristic algorithm which produces a good suboptimal solution in polynomial time. For the special case where the input query is a “tree query,” we present an efficient algorithm for finding an optimal nesting order.