1 / 10

HW7: Sort-Merge Join

HW7: Sort-Merge Join. Instructors: Winston Hsu, Hao-Hua Chu Fall 2012. Architecture of a DBMS. Query. Query Optimization and Execution. Relation Operators(Join). File and Access Methods. Buffer Management. Disk Space Management. DB. Merge Sort. Sort by sname. Get the first tuples.

royal
Download Presentation

HW7: Sort-Merge Join

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. HW7: Sort-Merge Join Instructors: Winston Hsu, Hao-HuaChu Fall 2012

  2. Architecture of a DBMS Query Query Optimization and Execution Relation Operators(Join) File and Access Methods Buffer Management Disk Space Management DB

  3. MergeSort Sort by sname Get the first tuples Merge

  4. Pseudo Code

  5. Task 1: Sort • Sort::Sort(…) • Specifies input file name and output file name

  6. Task 2: Storage & Scan • HeapFile::HeapFile(…) • Open data with HeapFile • HeapFile::openScan(…) • Returns a scan of the HeapFile • Scan::getNext(…) • Get next record

  7. Task 3: Merge • tupleCmp() • Compare tuples • HeapFile::insertRecord(…) • Insert a record into the file • Scan::position(…) • Position the scan cursor to the record with rid.

  8. Heap File

  9. Output • Format: if = ,then write recR recB recR recB

  10. Administration • If there are any questions, you can post them on ptt.cc/ CSIE_DBMS, or mail to: woptspencil@gmail.com • Deadline: 23:59 Jan 9 (Wednesday), 2013

More Related