cockroachdb / cockroachdb/cockroach

opt: add implicit FOR SHARE locking to initial scan of INSERT SELECT

Open
#148,208 0 comments 0 reactions 0 assignees View on GitHub
A-sql-mutations A-sql-optimizer C-performance T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Under serializable isolation, INSERT INTO ... SELECT FROM statements can fail if the rows read from the SELECT portion are modified by another transaction. To avoid this, we could add implicit FOR SHARE locking to the initial scan of the SELECT portion of the statement, similar to what we do for UPDATE and DELETE.

Jira issue: CRDB-51476

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.