1 / 11

One Pass Algorithm Presented By: Pradhyuman raol ID : 114

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.

elma
Download Presentation

One Pass Algorithm Presented By: Pradhyuman raol ID : 114

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. One Pass Algorithm Presented By: Pradhyuman raol ID : 114 Instructor: Dr T.Y. LIN

  2. Agenda • One Pass algorithm • Tuple-at-a-Time • Unary Operators • Binary Operations

  3. 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.

  4. 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

  5. Tuple at a time Diagram R Unary operator Input buffer Output buffer

  6. 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

  7. 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 – For any count aggregation, add one for each tuple of the group that is seen. • Sum- add the value of attribute a to the accumulated sum for its group provided, a is not NULL. • Average

  8. Binary Operations • Set Union- We read S into M-1 buffers of main memory and build a search structure whose search key is the entire tuple. • Set Intersection- Read S into M-1 buffers and build a search structure with full tuples as the search key.

  9. Continued… Set Difference Bag Intersection Bag Difference Product Natural Join- To compute the Natural Join we have to do the following: 1.Read all the tuples of S form them into a main memory search structures with the attributes of Y as the search key. Use M-1 block of memory for this purpose.

  10. Continued… 2. Read each block of R into the one remaining main memory buffer. For each tuple t of R, find the tuples of S that agree with t on all attributes of Y, using the search Structure. For each matching tuple S, form a tuple by joining it with t, and move the resulting tuple to the output.

  11. Thank You

More Related