title | summary | toc |
---|---|---|
CONFIGURE ZONE |
Use the CONFIGURE ZONE statement to add, modify, reset, and remove replication zones. |
true |
Use CONFIGURE ZONE
to add, modify, reset, and remove replication zones. To view details about existing replication zones, see SHOW ZONE CONFIGURATIONS
.
In CockroachDB, you can use replication zones to control the number and location of replicas for specific sets of data, both when replicas are first added and when they are rebalanced to maintain cluster equilibrium.
{{site.data.alerts.callout_info}} Adding replication zones for rows and secondary indexes is an enterprise-only feature. {{site.data.alerts.end}}
alter_zone_range_stmt ::=
alter_zone_database_stmt ::=
alter_zone_table_stmt ::=
alter_zone_index_stmt ::=
Currently, only the root
user can configure replication zones.
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.
variable
| The name of the variable to change.
value
| The value of the variable to change.
DISCARD
| Remove a replication zone.
{% include {{ page.version.version }}/zone-configs/variables.md %}
{% include {{ page.version.version }}/misc/schema-change-view-job.md %}
{% include copy-clipboard.html %}
> ALTER TABLE t CONFIGURE ZONE USING range_min_bytes = 0, range_max_bytes = 90000, gc.ttlseconds = 89999, num_replicas = 4, constraints = '[-region=west]';
CONFIGURE ZONE 1
{% include {{ page.version.version }}/zone-configs/edit-the-default-replication-zone.md %}
{% include {{ page.version.version }}/zone-configs/create-a-replication-zone-for-a-database.md %}
{% include {{ page.version.version }}/zone-configs/create-a-replication-zone-for-a-table.md %}
{% include {{ page.version.version }}/zone-configs/create-a-replication-zone-for-a-secondary-index.md %}
{% include {{ page.version.version }}/zone-configs/create-a-replication-zone-for-a-table-partition.md %}
{% include {{ page.version.version }}/zone-configs/create-a-replication-zone-for-a-system-range.md %}
{% include {{ page.version.version }}/zone-configs/reset-a-replication-zone.md %}
{% include {{ page.version.version }}/zone-configs/remove-a-replication-zone.md %}