Skip to main content

GROUP_FOLD_BATCH

Constant GROUP_FOLD_BATCH 

Source
pub const GROUP_FOLD_BATCH: usize = 65_536;
Expand description

Rows per fold batch in the GROUP BY executor’s pipelined loop.

The GROUP BY executor consumes its whole input regardless of any parent LIMIT (exact counts), so a larger page amortizes the per-batch round trip without over-scanning: each page is fully folded while the next page streams in. Deliberately OVER the unary wire budget (~150 B/quad means 65536 rows ≈ 9.8 MiB, far past the 4 MiB waratah_proto::GRPC_MAX_MESSAGE_SIZE): fold pages always exceed SCAN_BATCH, so they always take the streaming transport, whose frames are chunked under the cap — a page demand only sizes the drain, never one wire message.