forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiregionccl: add unsafe_optimize_system_database
crdb_internal.unsafe_optimize_system_database optimizes the system database for multi region deployments by configuring latency critical tables as global or regional by row. Tables that are sensitive to read latency were converted to global. Table that are sensitive to write latency were converted to regional by row. system.sqlliveness and system.sql_instances were reworked by (cockroachdb#90408) and (cockroachdb#92010) to have a primary key index that is binary compatible with regional by row tables. The conversion to regional by row is implemented as a built in function because it is not possible to use `ALTER TABLE ... SET LOCALITY REGIONAL BY ROW` to perform the conversion. Using alter table to convert the RBR tables has two challenges: 1. There is no way to convert the crdb_region column from []byte to the region enum type. 2. Changing the locality to RBR always rewrites the primary index. The sqlliveness and sql_instance subsystems use the raw kv API and expect a specific index ID. Rewriting the primary index changes the ID and breaks the subsystems. Release note: None Part of cockroachdb#85736
- Loading branch information
1 parent
c4c1d20
commit bb388da
Showing
8 changed files
with
256 additions
and
104 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.