Slideshow:
|
|
Reason:
|
|
|
|
|
Detailed explanation:
|
|
There are no memory restrictions on pass 1 and pass 2 !!!
Pass 3 must merge: ≤ M−1 chunks;
Each chunk in pass 3 has size ≤ (M−1)M blocks
Maximum file size ≤ (M−1)2M blocks
|
Pass 1: read R + write sorted chunks = 2 B(R)
Pass 2: read sorted chunks + write bigger chunks = 2 B(R)
Pass 3: read bigger chunks + sort = 1 B(R)
(Let's not count final output write to disk...)
Total = 5 B(R)
|
|
Pass 3 merges: ≤ M−1 chunks;
Each chunk in pass 3 has size ≤ (M−1)2 M blocks
Maximum file size ≤ (M−1)3 M blocks
|
Pass 1: read R + write sorted chunks = 2 B(R)
Pass 2: read sorted chunks + write bigger chunks = 2 B(R)
Pass 3: read bigger sorted chunks + write biggest chunks = 2 B(R)
Pass 3: read bigger chunks + sort = 1 B(R)
(Again: let's not count final output write to disk...)
Total = 7 B(R)
|
Pass 1:
Same as pass 1 of TPMMS
Cost: 2 B(R) disk IOs
Size of each chunk at end: M blocks
|
# disk IOs = 2(k-1) B(R) (if we don't count final output IO)
Or:
# disk IOs = 2 k B(R) (if we include final output IO)
|
|