Table of Contents
Fetching ...

Intermediate Relation Size Bounds for Select-Project-Join-Union Query Plans

Hubie Chen, Markus Schneider

TL;DR

A plan measure is defined to be the minimum degree of a polynomial bounding the size of all intermediate relations computed during a plan's execution -- again, as a function of the input database's maximum relation size.

Abstract

We study the problem of statically optimizing select-project-join-union (SPJU) plans where unary key constraints are allowed. A natural measure of a plan, which we call the output degree and which has been studied previously, is the minimum degree of a polynomial bounding the plan's output relation, as a function of the input database's maximum relation size. This measure is, by definition, invariant under passing from a plan to another plan that is semantically equivalent to the first. In this article, we consider a plan measure which we call the intermediate degree; this measure is defined to be the minimum degree of a polynomial bounding the size of all intermediate relations computed during a plan's execution -- again, as a function of the input database's maximum relation size. We present an algorithm that, given an SPJU plan $p$ and a set $Σ$ of unary keys, computes an SPJU plan $p'$ that is semantically equivalent to $p$ (over databases satisfying $Σ$) and that has the minimum intermediate degree over all such semantically equivalent plans. For the types of plans considered, we thus obtain a complete and effective understanding of intermediate degree.

Intermediate Relation Size Bounds for Select-Project-Join-Union Query Plans

TL;DR

A plan measure is defined to be the minimum degree of a polynomial bounding the size of all intermediate relations computed during a plan's execution -- again, as a function of the input database's maximum relation size.

Abstract

We study the problem of statically optimizing select-project-join-union (SPJU) plans where unary key constraints are allowed. A natural measure of a plan, which we call the output degree and which has been studied previously, is the minimum degree of a polynomial bounding the plan's output relation, as a function of the input database's maximum relation size. This measure is, by definition, invariant under passing from a plan to another plan that is semantically equivalent to the first. In this article, we consider a plan measure which we call the intermediate degree; this measure is defined to be the minimum degree of a polynomial bounding the size of all intermediate relations computed during a plan's execution -- again, as a function of the input database's maximum relation size. We present an algorithm that, given an SPJU plan and a set of unary keys, computes an SPJU plan that is semantically equivalent to (over databases satisfying ) and that has the minimum intermediate degree over all such semantically equivalent plans. For the types of plans considered, we thus obtain a complete and effective understanding of intermediate degree.

Paper Structure

This paper contains 31 sections, 18 theorems, 9 equations, 1 figure.

Key Result

Proposition 1

Let $(\mathbf{A},\overline{a})$ and $(\mathbf{A}',\overline{a'})$ be open structures over some signature $\sigma$. There exists a homomorphism from $(\mathbf{A},\overline{a})$ to $(\mathbf{A}',\overline{a'})$ if and only if for each structure $\mathbf{D}$ over $\sigma$ we have that $\mathsf{homs}(\m

Figures (1)

  • Figure :

Theorems & Definitions (26)

  • Proposition 1: ChandraMerlin77-optimal
  • Proposition 2
  • Proposition 3
  • Definition 4: Output Degree
  • Definition 5: Intermediate Degree
  • Theorem 6: Main theorem
  • Theorem 7
  • Theorem 8
  • Proposition 9
  • Lemma 10
  • ...and 16 more