Logical Query Plans - Cost Model




CS157b

Chris Pollett

Mar 1, 2023

Outline

Introduction

Relational Algebra Expressions

Expression Trees

In-Class Exercise

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