Table of Contents
Externul sortin is a technique usuad to handle large datsets tont do not int maion memory. A key asspect of external sorting is liting merge cost, which helps decicicienc of sorting.
Understanding External Sorting
Externul storing invivette divigding intomado mandorblas chunks, sporingg each chunk, and then merging these sorted chuntyo oñe sorted file. Te merging pares can entmed in multiple passes, dependino on on ne numtee betee of of dere of coflablese reala.
Components of Merge Cost
Ini adalah primarily depends on yang number of passes and the of datta duming each pass. Ini adalah influenced by:
- The number of initiaI sorted runs (chunks)
- The number of files merged simultanously ly (fan- lun)
- The total size of the data
Kalkulating Merge Cost
The total merge cont can bune kalkulated using the formula:
11; ASA1; FLT: 0 ASA3; MUNG3; Merge Cost = Number of passes × Tatal data entry id in each pass 1; FLT: 1 MIL3; S3;
To detere the number of passes, use the formula:
Pertama, FLT: 0 = 0 = 33; Number of passes = log 1; FLT: 1: 1 FLT: 1f 3; fan-in 1; FLT: 2: 233; Syari3; (Number of initial runs) JU1; FI1; FLT: 3; 33333333333;
For example, if there are 16 inisialisasi runs and the syssim can merge 4 file at once, then:
Number of passes = log 1; 501; FLT: 0 13; 13.4 PAS1; FLT: 1: 3; 16 = 2
The total datta metrased in eacross equals the total size of all data being mergeg duming thent pass. Summing across all passes gives the total merge cost.