Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instructors: Winston Hsu, Hao-Hua Chu Fall 2010

Similar presentations


Presentation on theme: "Instructors: Winston Hsu, Hao-Hua Chu Fall 2010"— Presentation transcript:

1 Instructors: Winston Hsu, Hao-Hua Chu Fall 2010
HW6: Sort-Merge Join Instructors: Winston Hsu, Hao-Hua Chu Fall 2010

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

3 Sort-Merge Join

4 Example Sort by sname Get the first tuples Merge sid sname 31 A 28 E
22 36 C 44 D sid sname 31 A 22 36 C 44 D 28 E sname BID A 112 168 B 101 C 118 sname BID C 118 B 112 A 168 101 Sort by sname sid sname BID 31 A 112 168 22 36 C 118 Get the first tuples Merge

5 Some APIs Sort constructor(… outfile …) HeapFile constructor
Outfile : Name of sorted heapfile should be distinct HeapFile constructor HeapFile->openScan() Followed by scan->getNext() and get the firstRecord tupleCmp() : compare tuples Scan->position() Position the scan cursor to the record with the given rid.

6 Other Output format: If there are any questions, you can post them on ptt.cc / CSIE_DBMS, or mail to: Deadline: 23:59 Jan 12 (Wednesday), 2011 if = ,then write recA recA recA recA

7 Heapfile “Database Management Systems, Third Edition” by Ramakrishnan and Gehrke


Download ppt "Instructors: Winston Hsu, Hao-Hua Chu Fall 2010"

Similar presentations


Ads by Google