cockroachdb / cockroachdb/cockroach

sql: make prepared insert batches use bulk inserts

Open
#99,319 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.