Two Pass Query Algorithms




CS157b

Chris Pollett

Feb 28, 2018

Outline

Introduction

One Pass Algorithms for Binary Operations

Recall `M =` number of memory blocks; `B(T)` = number of blocks in table `T`.

More One Pass Algorithms for Binary Operations

In-Class Exercise

Nested Loop Joins

More Nested Loop Join

Two Pass Algorithms Based On Sorting

Duplicate Elimination using Sorting

Given `R` we sort `R` and output distinct values.

Sort Based Duplicate Elimination

Grouping and Aggregation using Sorting

Sorting and Unions, Intersections, etc.

Sort-based Join

Partitioning Relations by Hashing

Hashed based Duplicate Elimination