Query Execution




CS157b

Chris Pollett

Feb 26, 2018

Outline

Introduction

Query execution flowchart

An Algebra for Queries

Relational Algebra Expressions

Expression Trees

Quiz

Which of the following statements is true?

  1. Sqlite3 databases are ISAM based.
  2. A bitmap index is a kind of binary search tree.
  3. A kd-tree satisfies the property that beneath a non-leaf node on attribute `A` with check `V`, the records to the left of the node are less than `V` and those to the right are greater than or equal to `V`.

Physical Query Plan Operators

Model of Computation for Physical Operators

Parameters for Measuring Cost

I/O Cost for Scan Operators

Aside - Sorting in Secondary Storage

Bottom up Merge Sort

Two Phase Multiway Merge-Sort (TPMMS)

N-Way Merge sort

Phase I Example

Phase II

Phase II -cont'd (finish sorting in secondary storage aside)

How much more efficient is this last idea than just merging two blocks?

Iterators for Implementing Physical Operators

One Pass Algorithms -- Tuple at a Time Operations

One-Pass Algorithms for Unary, Full-Relation Operations