To achieve higher throughput during INSERT operations, you can stream the request body as a sequence of Native blocks. This allows the client to encode the next block of rows while the server is simultaneously inserting the previous block, overlapping the encoding and network/server costs.
Performance Gains
Streaming the INSERT body in chunks (e.g., 4096 rows) can provide a performance boost of approximately 30–40% compared to sending a single large pre-encoded block.
Important Trade-off: Atomicity
An INSERT operation split into multiple blocks is not atomic in the event of a client-side encoding error. If an error occurs while encoding a later block, the earlier blocks may have already been successfully sent and processed by the server. This is generally not a concern for valid, uniformly-typed data, as an encoding error would likely have triggered a failure on the very first block.