Skip to content

Commit b845bd8

Browse files
committed
opt: implement region-column inference
This commit finishes the implementation for the new storage parameter `infer_rbr_region_col_using_constraint`. If a foreign key constraint is specified via that setting, the constraint will be used to plan a lookup join into the parent table to retrieve the correct values for the region column on INSERT, UPDATE, and UPSERT operations. This will make it easier for customers to add the `crdb_region` column to their foreign-key constraints, since they no longer have to guarantee that an insert into the child table happens in the same region as the matching parent row. Fixes #148243 Release note (sql change): Added support for automatically determining the region column for a REGIONAL BY ROW table using a foreign key constraint. The foreign key is specified by setting a new table storage parameter `infer_rbr_region_col_using_constraint`, and must contain the region column. This can be useful for applications that are unable to guarantee that a child row is inserted or updated from the same region as the matching parent row.
1 parent e04132c commit b845bd8

File tree

5 files changed

+3627
-1
lines changed

5 files changed

+3627
-1
lines changed

0 commit comments

Comments
 (0)