On this page
Warning:
CockroachDB v2.1 is no longer supported as of April 30, 2020. For more details, refer to the Release Support Policy.
New in v2.1: Use the SHOW ZONE CONFIGURATIONS
statement to view details about existing replication zones.
Synopsis
Required privileges
No privileges are required to list replication zones.
Parameters
Parameter | Description |
---|---|
range_name |
The name of the system range for which to show replication zone configurations. |
database_name |
The name of the database for which to show replication zone configurations. |
table_name |
The name of the table for which to show replication zone configurations. |
partition_name |
The name of the partition for which to show replication zone configurations. |
index_name |
The name of the index for which to show replication zone configurations. |
Examples
View all replication zones
> SHOW ALL ZONE CONFIGURATIONS;
zone_name | config_sql
+-------------+-----------------------------------------------------+
.default | ALTER RANGE default CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 3,
| constraints = '[]',
| lease_preferences = '[]'
system | ALTER DATABASE system CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 5,
| constraints = '[]',
| lease_preferences = '[]'
system.jobs | ALTER TABLE system.public.jobs CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 600,
| num_replicas = 5,
| constraints = '[]',
| lease_preferences = '[]'
.meta | ALTER RANGE meta CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 3600,
| num_replicas = 5,
| constraints = '[]',
| lease_preferences = '[]'
.system | ALTER RANGE system CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 5,
| constraints = '[]',
| lease_preferences = '[]'
.liveness | ALTER RANGE liveness CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 600,
| num_replicas = 5,
| constraints = '[]',
| lease_preferences = '[]'
(6 rows)
View the default replication zone for the cluster
> SHOW ZONE CONFIGURATION FOR RANGE default;
zone_name | config_sql
+-----------+------------------------------------------+
.default | ALTER RANGE default CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 3,
| constraints = '[]',
| lease_preferences = '[]'
(1 row)
View the replication zone for a database
> SHOW ZONE CONFIGURATION FOR DATABASE tpch;
zone_name | config_sql
+-----------+------------------------------------------+
tpch | ALTER DATABASE tpch CONFIGURE ZONE USING
| range_min_bytes = 1048576,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 3,
| constraints = '[]',
| lease_preferences = '[]'
(1 row)
View the replication zone for a table
> SHOW ZONE CONFIGURATION FOR TABLE tpch.customer;
zone_name | config_sql
+---------------+-------------------------------------------------------+
tpch.customer | ALTER TABLE tpch.public.customer CONFIGURE ZONE USING
| range_min_bytes = 40000,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 3,
| constraints = '[]',
| lease_preferences = '[]'
(1 row)
View the replication zone for an index
> SHOW ZONE CONFIGURATION FOR INDEX tpch.customer@frequent_customers;
zone_name | config_sql
+---------------+-------------------------------------------------------+
tpch.customer | ALTER TABLE tpch.public.customer CONFIGURE ZONE USING
| range_min_bytes = 40000,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 3,
| constraints = '[]',
| lease_preferences = '[]'
(1 row)
View the replication zone for a table partition
> SHOW ZONE CONFIGURATION FOR PARTITION north_america OF TABLE roachlearn.students;
zone_name | config_sql
+-----------------------------------+------------------------------------------------------------------------------------------------+
roachlearn.students.north_america | ALTER PARTITION north_america OF INDEX roachlearn.public.students@primary CONFIGURE ZONE USING
| range_min_bytes = 16777216,
| range_max_bytes = 67108864,
| gc.ttlseconds = 90000,
| num_replicas = 3,
| constraints = '[+region=us]',
| lease_preferences = '[]'