cockroachdb / cockroachdb/cockroach
opt: add implicit FOR SHARE locking to initial scan of INSERT SELECT
Open
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
Assessment
This issue has not been assessed yet.