Skip to main content

COPY_IN_FLUSH_ROWS

Constant COPY_IN_FLUSH_ROWS 

Source
pub(crate) const COPY_IN_FLUSH_ROWS: usize = 32768;
Expand description

Number of parsed rows buffered before flushing a batch to the handler.

Each flush runs the full insert pipeline (catalog lookup, on-demand schema check, partition split, region write) and, without the pending-rows batcher, waits for it — so larger batches mean fewer round trips at the cost of linearly more memory per connection (decoder batch + rows buffer). The constant doubles as the arrow decoder’s batch size. High-rate COPY users should enable the pending-rows batcher (global-table-batch / BatcherOptions.protocols containing Postgres), which turns flushes into enqueues and makes the per-batch fixed costs negligible.