sql: make prepared insert batches use bulk inserts #99319
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-queries
SQL Queries Team
Make prepared batches process inserts in batches instead of row by row (ie when we see prepare/bind/exec on pgwire, treat “exec” to mean “batch” and only exec when batch gets big enough or we see a SYNC). I think this will work. Requires maintaining fail or success on a per row basis, JDBC prepared batch API supports this, its all run as one transaction but some rows can succeed and some can fail. In theory this should be the fastest insert path, no CSV parsing like in COPY and no ParseAndRequire overhead since values are strongly typed on the wire.
The idea is to follow the vectorized COPY lead and build up a coldata.Batch of each row and then throw those at the insert distsql processor.
Jira issue: CRDB-25814
The text was updated successfully, but these errors were encountered: