{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec04 - External Sorting Adapt fastest internal-sort...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
External Sorting Adapt fastest internal-sort methods. Quick sort …best average run time. Merge sort … best worst-case run time.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Internal Merge Sort Review Phase 1 Create initial sorted segments Natural segments Insertion sort Phase 2 Merge pairs of sorted segments, in merge passes, until only 1 segment remains.
Background image of page 2
External Merge Sort Sort 10,000 records. Enough memory for 500 records. Block size is 100 records. t IO = time to input/output 1 block (includes seek, latency, and transmission times) t IS = time to internally sort 1 memory load t IM = time to internally merge 1 block load
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
External Merge Sort Two phases. Run generation. A run is a sorted sequence of records. Run merging.
Background image of page 4
Run Generation Input 5 blocks. Sort. Output as a run. Do 20 times. 5t IO t IS 5t IO 200t IO + 20t IS DISK MEMORY 500 records 10,000 records 5 blocks 100 blocks
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Run Merging Merge Pass. Pairwise merge the
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 25

lec04 - External Sorting Adapt fastest internal-sort...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online