Skip to content

10. External Memory, Cache, and Database Sorting

Sorting beyond main memory: external merge sort, polyphase merge, cache-oblivious techniques, LSM compaction, and database sort phases.

indexslugname
286external-merge-sortExternal Merge Sort
287two-phase-multiway-merge-sortTwo Phase Multiway Merge Sort
288polyphase-merge-sortPolyphase Merge Sort
289balanced-k-way-merge-sortBalanced K Way Merge Sort
290cascade-merge-sortCascade Merge Sort
291distribution-sweeping-sortDistribution Sweeping Sort
292cache-aware-sortingCache Aware Sorting
293cache-oblivious-sortingCache Oblivious Sorting
294funnel-sortFunnel Sort
295buffer-tree-sortBuffer Tree Sort
296b-tree-bulk-load-sortB Tree Bulk Load Sort
297lsm-tree-compaction-sortLSM Tree Compaction Sort
298database-external-sortDatabase External Sort
299sort-merge-join-sort-phaseSort Merge Join Sort Phase
300replacement-selection-run-generationReplacement Selection Run Generation
301tape-merge-sortTape Merge Sort
302memory-mapped-external-sortMemory Mapped External Sort
303chunked-sortChunked Sort
304spill-sortSpill Sort
305parallel-external-merge-sortParallel External Merge Sort
306external-radix-sortExternal Radix Sort
307external-sample-sortExternal Sample Sort
308external-bucket-sortExternal Bucket Sort
309k-way-loser-tree-mergeK Way Loser Tree Merge
310k-way-winner-tree-mergeK Way Winner Tree Merge
External Merge SortSort data that does not fit in memory by dividing it into sorted runs and merging them using external storage.
3 min
TPMMSExternal sorting algorithm that performs run generation and a single multiway merge using limited memory.
3 min
Polyphase Merge SortExternal sorting algorithm that distributes sorted runs unevenly across files so repeated merges need fewer empty files and less redistribution.
4 min
Balanced K Way Merge SortExternal sorting algorithm that repeatedly merges groups of k sorted runs until one final sorted run remains.
4 min
Cascade Merge SortExternal sorting method that merges sorted runs through staged levels so output from one level feeds the next.
4 min
Distribution Sweeping SortExternal-memory sorting method that partitions data into key ranges, sorts each range, and concatenates the sorted partitions.
3 min
Cache Aware SortingSorting techniques that explicitly use knowledge of cache size and block size to minimize memory hierarchy cost.
3 min
Cache Oblivious SortingSorting techniques that achieve good cache behavior without explicitly knowing cache size or block size.
3 min
Funnel SortCache oblivious sorting algorithm that achieves optimal memory transfer complexity using recursive multiway merging structures called funnels.
3 min
Buffer Tree SortExternal-memory sorting method that inserts records into a buffered tree and extracts them in sorted order.
4 min
B Tree Bulk Load SortSorting method that builds a B-tree directly from sorted data using bulk loading to minimize I/O operations.
3 min
LSM Compaction SortSorting through hierarchical merging in Log Structured Merge Trees using compaction across levels.
3 min
Database External SortExternal sorting procedure used by database systems for ORDER BY, GROUP BY, DISTINCT, and sort-merge joins.
4 min
Sort Merge Join Sort PhaseThe sorting stage used before a sort-merge join when one or both inputs are not already ordered by the join key.
4 min
Replacement Selection Run GenerationExternal sorting technique that uses a heap to produce initial sorted runs longer than the available memory.
4 min
Tape Merge SortExternal sorting algorithm that distributes sorted runs across sequential storage tapes and repeatedly merges them.
3 min
Memory Mapped External SortExternal sorting method that uses memory-mapped files so large data can be accessed through virtual memory while still sorting in chunks and merging runs.
4 min
Chunked SortSorting method that divides input into bounded-size chunks, sorts each chunk independently, and then combines the chunks.
3 min
Spill SortSorting method that keeps data in memory until a memory limit is reached, then spills sorted runs to external storage and merges them.
3 min
Parallel External Merge SortExternal sorting algorithm that performs run generation and merging concurrently across multiple processors and disks.
3 min
External Radix SortExternal-memory radix sort that processes large datasets by distributing records into digit-based buckets across multiple passes.
3 min
External Sample SortExternal-memory sorting algorithm that uses sampling to partition data into balanced buckets, then sorts each bucket independently.
3 min
External Bucket SortExternal-memory bucket sort that partitions records into ordered buckets stored on disk and sorts each bucket separately.
3 min
Loser Tree MergeEfficient k-way merge using a tournament tree that stores losers to reduce comparisons and improve external merge performance.
3 min
Winner Tree MergeK-way merge using a tournament tree that stores winners at internal nodes and repeatedly updates the winning path.
4 min