算法 Proc export(file) Read B page into memory, sort them, write out a run While the number of runs at end of previous pass >1 while there are runs to be merged from previous pass choose next B-1 runs(from previous pass) read each run into an input buffer; page at at time Merge the runs and write to the output buffer force output buffer to disk one page at a time wndproc算法 Proc exsort(file) Read B page into memory, sort them, write out a run While the number of runs at end of previous pass >1 while there are runs to be merged from previous pass choose next B-1 runs(from previous pass) read each run into an input buffer; page at at time Merge the runs and write to the output buffer force output buffer to disk one page at a time endproc