Memory cards
External sort spills sorted runs and merges them
confidence: mediumupdated: 2026-11-25status: activedatabasesortspill
Claim#
Memory fills, runs are written to disk and a merge follows. The spill path is the cost.
Test#
Sort more rows than the memory limit. Measure spill bytes and merge time.
Proof#
A sorted result within the disk budget.
Failure modes#
A spill to a slow disk stalls the query. A merge with too many runs hits the file limit.