90 likes | 209 Views
One Pass Algorithm Presented By: Pradhyuman raol ID : 114. Instructor : Dr T.Y. LIN. Agenda . One Pass algorithm Tuple-at-a-Time Unary Operators Binary Operations. One-Pass Algorithms . One Pass Algorithm: Some methods involve reading the data only once from disk.
E N D
One Pass Algorithm Presented By: Pradhyuman raol ID : 114 Instructor: Dr T.Y. LIN
Agenda • One Pass algorithm • Tuple-at-a-Time • Unary Operators • Binary Operations
One-Pass Algorithms • One Pass Algorithm: • Some methods involve reading the data only once from disk. • They work only when at least one of the arguments of the operation fits in main memory.
Tuple-at-a-Time • We read the blocks of R one at a time into an input buffer, perform the operation on the tuple, and more the selected tuples or the projected tuples to the output buffer. • Examples: Selection & Projection
Tuple at a time Diagram R Unary operator Input buffer Output buffer
Unary Operators • The unary operations that apply to relations as a whole, rather than to one tuple at a time. • Duplicate Elimination d(R) :Check whether that tuple is already there or not. M= Main memory B(d(R))= Size of Relation R Assumption: B(d(R)) <= M
Unary Operators • Grouping : A grouping operation gives us zero or more grouping attributes and presumably one or more accumulated value or values for each aggregation. • Min or Max • Count • Sum • Average
Binary Operations • Set Union • Set Intersection • Set Difference • Bag Intersection • Bag Difference • Product • Natural join