-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt: inline constant values for FK and uniqueness checks
In FK and uniqueness checks, WithScans that buffer the mutation's input are replaced with Values expression when inserted values are constant. This is especially beneficial for `REGIONAL BY ROW` tables where the `crdb_region` column is a computed column dependent on a FK. Because the constant values are inlined, the optimizer is not able to reduce a FK check that scans multiple regions with a FK check that checks only a single region. Informs #63882 Release note (performance improvement): Previously, foreign key checks performed for inserts into `REGIONAL BY ROW` tables always searched the parent table in all regions to check for FK violations. Now, only a single region is searched if constant values are inserted and the `crdb_region` column is a computed column dependent on the FK column.
- Loading branch information
Showing
21 changed files
with
1,091 additions
and
808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.