-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: defer FK checks to end of statement #33475
Copy link
Copy link
Closed
Labels
A-sql-executionRelating to SQL execution.Relating to SQL execution.A-sql-fksA-sql-mutationsMutation statements: UPDATE/INSERT/UPSERT/DELETE.Mutation statements: UPDATE/INSERT/UPSERT/DELETE.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Description
Discussed with @BramGruneir and team. The current semantics in CRDB 2.1 are incorrect -- the FK work must be deferred to no earlier than the end of the current statement.
In the first iteration of this we are reusing the same FK code; and instead delay the processing until the end of the statement's execution by means of callbacks.
Also the set of modified rows must be collected using a "disk row writer" that spills to disk to limit RAM usage.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-executionRelating to SQL execution.Relating to SQL execution.A-sql-fksA-sql-mutationsMutation statements: UPDATE/INSERT/UPSERT/DELETE.Mutation statements: UPDATE/INSERT/UPSERT/DELETE.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)