Fish Touching🐟🎣

Query Optimization

Apr 24, 2023

# Terms


# Common Heuristics

  1. Push down projects (π) and selects (σ) before join
    • select or project ASAP
  2. Only consider left deep plans
    • Each node represents a relational operation such as a selection, projection, or join.
    • Each leaf is the actual table.
    • image.png
  3. Avoid cross joins (Cartesian products) unless they are the only option

# First Pass of System R

(pass i involves finding the best plans for sets of i tables, so pass 1 involves finding the best plans for sets of 1 table).(pass i involves finding the best plans for sets of i tables, so pass 1 involves finding the best plans for sets of 1 table).

# Volcano model

image.png
The operators are layered atop one another, and each operator requests tuples from the input operator(s) as it needs to generate its next output tuple. Note that each operator only fetches tuples from its input operator(s) as needed, rather than all at once! the operators are layered atop one another, and each operator requests tuples from the input operator(s) as it needs to generate its next output tuple. Note that each operator only fetches tuples from its input operator(s) as needed, rather than all at once!

# Notes