Expand description
Sort/merge helpers for ORDER BY / LIMIT on generated IDB output.
Used by both binary mode (drain → sort → write file) and library mode
(drain → sort → populate BatchResults). Pure algorithms over
user-supplied comparators — no allocation beyond the inputs.
Functions§
- k_
way_ merge - Stream a k-way merge of pre-sorted per-worker buffers into
sink. - topk
- Return the top-
kofrowsbycmp, fully sorted.