> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW ZONE CONFIGURATIONS

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

Use the `SHOW ZONE CONFIGURATIONS` <InternalLink path="sql-statements">statement</InternalLink> to view details about existing <InternalLink path="configure-replication-zones">replication zones</InternalLink>.

## Synopsis

<img src="https://mintcdn.com/cockroachlabs/M1Nto-joXUTgisRs/images/sql-diagrams/v25.3/show_zone.svg?fit=max&auto=format&n=M1Nto-joXUTgisRs&q=85&s=edb94957c7e571b87014bf4984546b95" alt="show_zone syntax diagram" style={{maxWidth: "100%", overflowX: "auto"}} width="1231" height="499" data-path="images/sql-diagrams/v25.3/show_zone.svg" />

## Required privileges

No <InternalLink path="security-reference/authorization#managing-privileges">privileges</InternalLink> are required to list replication zones.

## Parameters

| Parameter        | Description                                                                                                                                                                                               |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `zone_name`      | The name of the system <InternalLink path="architecture/overview">range</InternalLink> for which to show <InternalLink path="configure-replication-zones">replication zone configurations</InternalLink>. |
| `database_name`  | The name of the <InternalLink path="create-database">database</InternalLink> for which to show <InternalLink path="configure-replication-zones">replication zone configurations</InternalLink>.           |
| `table_name`     | The name of the <InternalLink path="create-table">table</InternalLink> for which to show <InternalLink path="configure-replication-zones">replication zone configurations</InternalLink>.                 |
| `partition_name` | The name of the <InternalLink path="partitioning">partition</InternalLink> for which to show <InternalLink path="configure-replication-zones">replication zone configurations</InternalLink>.             |
| `index_name`     | The name of the <InternalLink path="indexes">index</InternalLink> for which to show <InternalLink path="configure-replication-zones">replication zone configurations</InternalLink>.                      |

## Examples

#### Setup

The following examples use MovR, a fictional vehicle-sharing application, to demonstrate CockroachDB SQL statements. For more information about the MovR example application and dataset, see <InternalLink path="movr">MovR: A Global Vehicle-sharing App</InternalLink>.

To follow along, run <InternalLink path="cockroach-demo">`cockroach demo`</InternalLink> with the `--geo-partitioned-replicas` flag. This command opens an interactive SQL shell to a temporary, 9-node in-memory cluster with the `movr` database.

```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
$ cockroach demo --geo-partitioned-replicas
```

### View all replication zones

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ALL ZONE CONFIGURATIONS;
```

```
                                              target                                             |                                                      raw_config_sql
-------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------
  RANGE default                                                                                  | ALTER RANGE default CONFIGURE ZONE USING
                                                                                                 |     range_min_bytes = 134217728,
                                                                                                 |     range_max_bytes = 536870912,
                                                                                                 |     gc.ttlseconds = 90000,
                                                                                                 |     num_replicas = 3,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  DATABASE system                                                                                | ALTER DATABASE system CONFIGURE ZONE USING
                                                                                                 |     range_min_bytes = 134217728,
                                                                                                 |     range_max_bytes = 536870912,
                                                                                                 |     gc.ttlseconds = 90000,
                                                                                                 |     num_replicas = 5,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  RANGE meta                                                                                     | ALTER RANGE meta CONFIGURE ZONE USING
                                                                                                 |     range_min_bytes = 134217728,
                                                                                                 |     range_max_bytes = 536870912,
                                                                                                 |     gc.ttlseconds = 3600,
                                                                                                 |     num_replicas = 5,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  RANGE system                                                                                   | ALTER RANGE system CONFIGURE ZONE USING
                                                                                                 |     range_min_bytes = 134217728,
                                                                                                 |     range_max_bytes = 536870912,
                                                                                                 |     gc.ttlseconds = 90000,
                                                                                                 |     num_replicas = 5,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  RANGE liveness                                                                                 | ALTER RANGE liveness CONFIGURE ZONE USING
                                                                                                 |     range_min_bytes = 134217728,
                                                                                                 |     range_max_bytes = 536870912,
                                                                                                 |     gc.ttlseconds = 600,
                                                                                                 |     num_replicas = 5,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  TABLE system.public.replication_constraint_stats                                               | ALTER TABLE system.public.replication_constraint_stats CONFIGURE ZONE USING
                                                                                                 |     gc.ttlseconds = 600,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  TABLE system.public.replication_stats                                                          | ALTER TABLE system.public.replication_stats CONFIGURE ZONE USING
                                                                                                 |     gc.ttlseconds = 600,
                                                                                                 |     constraints = '[]',
                                                                                                 |     lease_preferences = '[]'
  PARTITION us_west OF INDEX movr.public.users@primary                                           | ALTER PARTITION us_west OF INDEX movr.public.users@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_east OF INDEX movr.public.users@primary                                           | ALTER PARTITION us_east OF INDEX movr.public.users@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION europe_west OF INDEX movr.public.users@primary                                       | ALTER PARTITION europe_west OF INDEX movr.public.users@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  PARTITION us_west OF INDEX movr.public.vehicles@primary                                        | ALTER PARTITION us_west OF INDEX movr.public.vehicles@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_west OF INDEX movr.public.vehicles@vehicles_auto_index_fk_city_ref_users          | ALTER PARTITION us_west OF INDEX movr.public.vehicles@vehicles_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_east OF INDEX movr.public.vehicles@primary                                        | ALTER PARTITION us_east OF INDEX movr.public.vehicles@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION us_east OF INDEX movr.public.vehicles@vehicles_auto_index_fk_city_ref_users          | ALTER PARTITION us_east OF INDEX movr.public.vehicles@vehicles_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION europe_west OF INDEX movr.public.vehicles@primary                                    | ALTER PARTITION europe_west OF INDEX movr.public.vehicles@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  PARTITION europe_west OF INDEX movr.public.vehicles@vehicles_auto_index_fk_city_ref_users      | ALTER PARTITION europe_west OF INDEX movr.public.vehicles@vehicles_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  PARTITION us_west OF INDEX movr.public.rides@primary                                           | ALTER PARTITION us_west OF INDEX movr.public.rides@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_west OF INDEX movr.public.rides@rides_auto_index_fk_city_ref_users                | ALTER PARTITION us_west OF INDEX movr.public.rides@rides_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_west OF INDEX movr.public.rides@rides_auto_index_fk_vehicle_city_ref_vehicles     | ALTER PARTITION us_west OF INDEX movr.public.rides@rides_auto_index_fk_vehicle_city_ref_vehicles CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_east OF INDEX movr.public.rides@primary                                           | ALTER PARTITION us_east OF INDEX movr.public.rides@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION us_east OF INDEX movr.public.rides@rides_auto_index_fk_city_ref_users                | ALTER PARTITION us_east OF INDEX movr.public.rides@rides_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION us_east OF INDEX movr.public.rides@rides_auto_index_fk_vehicle_city_ref_vehicles     | ALTER PARTITION us_east OF INDEX movr.public.rides@rides_auto_index_fk_vehicle_city_ref_vehicles CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION europe_west OF INDEX movr.public.rides@primary                                       | ALTER PARTITION europe_west OF INDEX movr.public.rides@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  PARTITION europe_west OF INDEX movr.public.rides@rides_auto_index_fk_city_ref_users            | ALTER PARTITION europe_west OF INDEX movr.public.rides@rides_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  PARTITION europe_west OF INDEX movr.public.rides@rides_auto_index_fk_vehicle_city_ref_vehicles | ALTER PARTITION europe_west OF INDEX movr.public.rides@rides_auto_index_fk_vehicle_city_ref_vehicles CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  PARTITION us_west OF INDEX movr.public.vehicle_location_histories@primary                      | ALTER PARTITION us_west OF INDEX movr.public.vehicle_location_histories@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_east OF INDEX movr.public.vehicle_location_histories@primary                      | ALTER PARTITION us_east OF INDEX movr.public.vehicle_location_histories@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION europe_west OF INDEX movr.public.vehicle_location_histories@primary                  | ALTER PARTITION europe_west OF INDEX movr.public.vehicle_location_histories@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
  TABLE movr.public.promo_codes                                                                  | ALTER TABLE movr.public.promo_codes CONFIGURE ZONE USING
                                                                                                 |     num_replicas = 3,
                                                                                                 |     constraints = '{+region=us-east1: 1}',
                                                                                                 |     lease_preferences = '[[+region=us-east1]]'
  INDEX movr.public.promo_codes@promo_codes_idx_us_west                                          | ALTER INDEX movr.public.promo_codes@promo_codes_idx_us_west CONFIGURE ZONE USING
                                                                                                 |     num_replicas = 3,
                                                                                                 |     constraints = '{+region=us-west1: 1}',
                                                                                                 |     lease_preferences = '[[+region=us-west1]]'
  INDEX movr.public.promo_codes@promo_codes_idx_europe_west                                      | ALTER INDEX movr.public.promo_codes@promo_codes_idx_europe_west CONFIGURE ZONE USING
                                                                                                 |     num_replicas = 3,
                                                                                                 |     constraints = '{+region=europe-west1: 1}',
                                                                                                 |     lease_preferences = '[[+region=europe-west1]]'
  PARTITION us_west OF INDEX movr.public.user_promo_codes@primary                                | ALTER PARTITION us_west OF INDEX movr.public.user_promo_codes@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-west1]'
  PARTITION us_east OF INDEX movr.public.user_promo_codes@primary                                | ALTER PARTITION us_east OF INDEX movr.public.user_promo_codes@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=us-east1]'
  PARTITION europe_west OF INDEX movr.public.user_promo_codes@primary                            | ALTER PARTITION europe_west OF INDEX movr.public.user_promo_codes@primary CONFIGURE ZONE USING
                                                                                                 |     constraints = '[+region=europe-west1]'
(34 rows)
```

### View the default replication zone for the cluster

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ZONE CONFIGURATION FROM RANGE default;
```

```
     target     |              raw_config_sql
----------------+-------------------------------------------
  RANGE default | ALTER RANGE default CONFIGURE ZONE USING
                |     range_min_bytes = 134217728,
                |     range_max_bytes = 536870912,
                |     gc.ttlseconds = 90000,
                |     num_replicas = 3,
                |     constraints = '[]',
                |     lease_preferences = '[]'
(1 row)
```

### View the replication zone for a database

To control replication for a specific database, use the `ALTER DATABASE ... CONFIGURE ZONE` statement to define the relevant values (other values will be inherited from the parent zone):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> ALTER DATABASE movr CONFIGURE ZONE USING num_replicas = 5, gc.ttlseconds = 100000;
```

```
CONFIGURE ZONE 1
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ZONE CONFIGURATION FROM DATABASE movr;
```

```
     target     |              raw_config_sql
----------------+-------------------------------------------
  DATABASE movr | ALTER DATABASE movr CONFIGURE ZONE USING
                |     range_min_bytes = 134217728,
                |     range_max_bytes = 536870912,
                |     gc.ttlseconds = 100000,
                |     num_replicas = 5,
                |     constraints = '[]',
                |     lease_preferences = '[]'
(1 row)
```

### View the replication zone for a table

To control replication for a specific table,  use the `ALTER TABLE ... CONFIGURE ZONE` statement to define the relevant values (other values will be inherited from the parent zone):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> ALTER TABLE users CONFIGURE ZONE USING num_replicas = 5, gc.ttlseconds = 100000;
```

```
CONFIGURE ZONE 1
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ZONE CONFIGURATION FROM TABLE users;
```

```
    target    |             raw_config_sql
--------------+-----------------------------------------
  TABLE users | ALTER TABLE users CONFIGURE ZONE USING
              |     range_min_bytes = 134217728,
              |     range_max_bytes = 536870912,
              |     gc.ttlseconds = 100000,
              |     num_replicas = 5,
              |     constraints = '[]',
              |     lease_preferences = '[]'
(1 row)
```

You can also use <InternalLink path="show-create">`SHOW CREATE TABLE`</InternalLink> to view zone configurations for a table. If a table is partitioned, but no zones are configured, the `SHOW CREATE TABLE` output includes a warning.

### View the replication zone for an index

To control replication for a specific index,  use the <InternalLink path="alter-index#configure-zone">`ALTER INDEX ... CONFIGURE ZONE`</InternalLink> statement to define the relevant values (other values will be inherited from the parent zone):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> ALTER INDEX vehicles@vehicles_auto_index_fk_city_ref_users CONFIGURE ZONE USING num_replicas = 5, gc.ttlseconds = 100000;
```

```
CONFIGURE ZONE 1
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ZONE CONFIGURATION FROM INDEX vehicles@vehicles_auto_index_fk_city_ref_users;
```

```
                         target                        |                                 raw_config_sql
-------------------------------------------------------+----------------------------------------------------------------------------------
  INDEX vehicles@vehicles_auto_index_fk_city_ref_users | ALTER INDEX vehicles@vehicles_auto_index_fk_city_ref_users CONFIGURE ZONE USING
                                                       |     range_min_bytes = 134217728,
                                                       |     range_max_bytes = 536870912,
                                                       |     gc.ttlseconds = 100000,
                                                       |     num_replicas = 5,
                                                       |     constraints = '[]',
                                                       |     lease_preferences = '[]'
(1 row)
```

### View the replication zone for a partition

<Tip>
  Most users should not need to use partitioning directly.  Instead, they should use CockroachDB's built-in <InternalLink path="multiregion-overview">multi-region capabilities</InternalLink>, which automatically handle geo-partitioning and other low-level details.
</Tip>

Once <InternalLink path="partitioning">partitions have been defined for a table or a secondary index</InternalLink>, to control replication for a partition, use `ALTER PARTITION <partition> OF INDEX <table@index> CONFIGURE ZONE`:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> ALTER PARTITION us_west OF INDEX vehicles@primary
    CONFIGURE ZONE USING
      num_replicas = 5,
      constraints = '[+region=us-west1]';
```

```
CONFIGURE ZONE 1
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> ALTER PARTITION us_west OF INDEX vehicles@vehicles_auto_index_fk_city_ref_users
    CONFIGURE ZONE USING
      num_replicas = 5,
      constraints = '[+region=us-west1]';
```

```
CONFIGURE ZONE 1
```

To define replication zones for identically named partitions of a table and its secondary indexes, you can use the `@*` syntax to save several steps:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> ALTER PARTITION us_west OF INDEX vehicles@*
    CONFIGURE ZONE USING
      num_replicas = 5,
      constraints = '[+region=us-west1]';
```

To view the zone configuration for a partition, use `SHOW ZONE CONFIGURATION FROM PARTITION <partition> OF INDEX <table@index>`:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ZONE CONFIGURATION FROM PARTITION us_west OF INDEX vehicles@primary;
```

```
                    target                    |                             raw_config_sql
----------------------------------------------+-------------------------------------------------------------------------
  PARTITION us_west OF INDEX vehicles@primary | ALTER PARTITION us_west OF INDEX vehicles@primary CONFIGURE ZONE USING
                                              |     range_min_bytes = 134217728,
                                              |     range_max_bytes = 536870912,
                                              |     gc.ttlseconds = 90000,
                                              |     num_replicas = 5,
                                              |     constraints = '[+region=us-west1]',
                                              |     lease_preferences = '[]'
(1 row)
```

<Tip>
  You can also use the <InternalLink path="show-create">`SHOW CREATE TABLE`</InternalLink> statement or <InternalLink path="show-partitions">`SHOW PARTITIONS`</InternalLink> statements to view details about all of the replication zones defined for the partitions of a table and its secondary indexes.
</Tip>

## See also

* <InternalLink path="configure-replication-zones">Replication Controls</InternalLink>
* <InternalLink path="alter-database#configure-zone">`ALTER DATABASE ... CONFIGURE ZONE`</InternalLink>
* <InternalLink path="alter-index#configure-zone">`ALTER INDEX ... CONFIGURE ZONE`</InternalLink>
* <InternalLink path="alter-range#configure-zone">`ALTER RANGE ... CONFIGURE ZONE`</InternalLink>
* <InternalLink path="alter-table#configure-zone">`ALTER TABLE ... CONFIGURE ZONE`</InternalLink>
* <InternalLink path="sql-statements">SQL Statements</InternalLink>
* <InternalLink path="troubleshoot-replication-zones">Troubleshoot Replication Zones</InternalLink>
