sql: the Insert planNode runs everything in one humongous batch #16180
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Milestone
Currently the
tableWriter
(and I assume alsotableUpdater
) does everything in one batch. This can lead to large Raft proposals (and it can run into thekv.raft.command.max_size
limit). If theInsert
is configured withautocommit
, then the batch is first checked against thekv.transaction.max_intents
limit.As a fun fact, it's currently possible to not hit the
max_size
limit, but subsequently hit thekv.transaction.max_intents
limit at commit time. I think this is not ideal since, if all the intents thatEndTransaction
needs to carry were produced by a single batch, and that batch was applied successfully, theEndTransaction
would probably apply successfully too.I think it'd be a significant improvement if the
Insert
node would chunk up its writes so that large batches and proposals are avoided.If we do this, and if we allow parallel execution of batches, there might be sequencing concerns to keep in mind for the
UPDATE
case - if a singleUPDATE
stmt updates a row twice, is it specified which one has to win?Also see #15713
The text was updated successfully, but these errors were encountered: