Skip to content

sql: pass COPY typed tuples through optimizer untouched #81731

@cucaroach

Description

@cucaroach

Inspired by /issues/52071 just create and cache the memo for a prepared insert. At first we could just execute each row in a loop but we should look at how to push the entire batch down to the KV boundary. @RaduBerinde outlines one possible way to do that in 52071. Ideally the COPY path and prepared insert batches can benefit from the same set of optimizations. Even further down the road would it make sense to have an enhanced (distsql based?) batch insert implementation that knew about cluster topology, did sorting and pre-range splitting etc to get around single node bottlenecks, this could potentially borrow/share code from bulk I/O.

After some thought it makes more sense to just pass the typed tuples through the optimizer and maybe later we can come back and use this approach for prepared statements.

Jira issue: CRDB-16061
Epic CRDB-14916

Metadata

Metadata

Assignees

Labels

A-migrationsMigrating to CRDB from another database vendorC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions