Overview
External Sort breaks a large input into memory-sized runs, sorts each run, writes it out, and performs one or more merge passes.
Sorts data sets that are too large to fit in memory by sorting chunks and merging them from disk.
Compact metadata for implementation and discovery.
External Sort breaks a large input into memory-sized runs, sorts each run, writes it out, and performs one or more merge passes.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n log n)
Average
O(n log n)
Worst
O(n log n)
Space
O(M) memory plus disk runs
Show disk-backed sorted runs feeding a multi-way merge buffer.
Real performance depends heavily on sequential I/O, buffer sizes, and merge fan-in.
What each reference supports for this entry.
Sorting and searching reference for external-memory sorting, run generation, and multiway merging.
Dictionary reference for external sorting over disk or tape memory and its relationship to external-memory algorithms.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
External sorting commonly creates sorted runs and merges them with merge-sort-style passes.