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

# ALTER INDEX

> The `ALTER INDEX` command modifies the definition of an index.

## Syntax

```sql theme={null}
ALTER INDEX index_name
    alter_option;
```

*`alter_option`* depends on the operation you want to perform on the index. For all supported clauses, see the sections below.

## Clause

### `RENAME TO`

```sql theme={null}
ALTER INDEX index_name
    RENAME TO new_name;
```

| Parameter or clause | Description                                                                                                                                                                                                       |
| :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **RENAME TO**       | This clause changes the name of the index. If the index is associated with a table constraint (either UNIQUE, PRIMARY KEY, or EXCLUDE), the constraint is renamed as well. There is no effect on the stored data. |
| *new\_name*         | The new name of the index.                                                                                                                                                                                        |

```sql theme={null}
-- Change the name of the index "idx_1" to "idx_2"
ALTER INDEX idx_1 RENAME TO idx_2.
```

### `SET PARALLELISM`

```sql theme={null}
ALTER INDEX index_name
SET PARALLELISM { TO | = } parallelism_number;
```

| Parameter or clause | Description                                                                                                                                                                                                                                                                                                                                                                                                                          |
| :------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SET PARALLELISM** | This clause controls the degree of [parallelism](/reference/key-concepts#parallelism) for the targeted [streaming job](/reference/key-concepts#streaming-queries).                                                                                                                                                                                                                                                                   |
| parallelism\_number | Can be `ADAPTIVE` or a fixed number (e.g., 1, 2, 3). Setting it to `ADAPTIVE` expands the job's parallelism to all available units, while a fixed number locks it at that value. Setting it to 0 is equivalent to `ADAPTIVE`. The maximum allowed value is determined by the `max_parallelism` of the job. For more information, see [Configuring maximum parallelism](/deploy/k8s-cluster-scaling#configuring-maximum-parallelism). |

```sql theme={null}
-- Set the parallelism of the index "idx_orders" to 3.
ALTER INDEX idx_orders SET PARALLELISM = 3;
```

### `SET BACKFILL_PARALLELISM`

```sql theme={null}
ALTER INDEX index_name
    SET BACKFILL_PARALLELISM { TO | = } parallelism_value [ DEFERRED ];
```

This statement controls the degree of parallelism used during the backfill phase of an index. It lets you tune resource usage for backfilling independently from the index's steady-state parallelism.

| Parameter or clause           | Description                                                                                                                                                                      |
| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SET BACKFILL\_PARALLELISM** | Sets the parallelism for the backfill phase of the streaming job.                                                                                                                |
| *parallelism\_value*          | Can be `ADAPTIVE` or a fixed number (e.g., 1, 2, 3). Setting it to `ADAPTIVE` or `0` expands backfill parallelism to all available units. A fixed number locks it at that value. |
| **DEFERRED**                  | Optional. When specified, the change takes effect after the current backfill completes, without interrupting an ongoing backfill. If omitted, the change is applied immediately. |

```sql theme={null}
-- Set backfill parallelism to a fixed value
ALTER INDEX idx_orders SET BACKFILL_PARALLELISM = 4;

-- Set backfill parallelism to adaptive
ALTER INDEX idx_orders SET BACKFILL_PARALLELISM = ADAPTIVE;

-- Defer the parallelism change until the current backfill completes
ALTER INDEX idx_orders SET BACKFILL_PARALLELISM = 4 DEFERRED;
```
