cockroachdb / cockroachdb/cockroach
sql: avoid locked read during FK check of global table
Open
A-multiregion
A-read-committed
C-performance
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Under RC isolation, FK checks use locked reads in order to avoid anomalies that would invalidate the FK check. But, these locked reads require a trip to the leaseholder replica.
If the FK we're checking is in a global table, we might not need to go all the way to the leaseholder. It might suffice to check the region-local replica and rely upon the properties of the global table to avoid anomalies.
Jira issue: CRDB-57680
Contributor guide
Assessment
This issue has not been assessed yet.