

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# Automatic database optimization
Automatic database optimization

Amazon Redshift hosts a set of automated features, termed collectively as autonomics, that enhance performance, reduce manual maintenance, and optimize resource usage. Autonomics leverage machine learning and background processes to manage database operations efficiently, automating many routine maintenance tasks to reduce database administrator workload.

The following table details Amazon Redshift's autonomics features:


| Autonomics feature | Description | 
| --- | --- | 
| Automatic vacuum sort | Amazon Redshift automatically reorganizes table data based on observed query patterns to ensure optimal sort order. This feature is enabled by default for tables with specified sort keys. For more information, see [Automatic table sort](t_Reclaiming_storage_space202.md#automatic-table-sort). | 
| Automatic vacuum delete | Amazon Redshift automatically runs vacuum operations to reclaim space from deleted rows and sort data. For more information on automatic vacuum delete operations, see [Automatic vacuum delete](t_Reclaiming_storage_space202.md#automatic-table-delete). | 
| Automatic table optimization | Amazon Redshift monitors query performance and table metadata to automatically determine the best sort and distribution keys for tables, and chooses the type of compression that is applied to a column of data values as rows are added to a table. For more information, see [Automatic table optimization](t_Creating_tables.md) and [Compression encodings](c_Compression_encodings.md). | 
| Automatic analyze | Amazon Redshift automatically analyzes tables as the data within them changes, ensuring that the query planner has up-to-date information for optimal execution plans. For more information on automatic analyze operations, see [Automatic analyze](t_Analyzing_tables.md#t_Analyzing_tables-auto-analyze). | 
| Automated materialized views | Amazon Redshift automatically creates and refreshes materialized views based on observed query patterns. This reduces the need for users to manually create or refresh views to benefit from faster query responses. For more information on materialized views, see [Materialized views in Amazon Redshift](materialized-view-overview.md). | 

These autonomics features are enabled by default and run automatically in the background during low-traffic periods to optimize your cluster's performance. You can refer to the [Default parameter values](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html#default-param-group-values) in the *Amazon Redshift Management Guide* to configure automatic features.

For clusters or workgroups with sustained high traffic, we recommend enabling extra compute resources to ensure continuous optimization. For more information, see [Allocating extra compute resources for automatic database optimization](t_extra-compute-autonomics.md).

**Topics**
+ [

# Allocating extra compute resources for automatic database optimization
](t_extra-compute-autonomics.md)
+ [

# Billing for autonomics operations
](t_autonomics-billing.md)
+ [

# Usage metrics for autonomics operations
](t_autonomics-usage-metrics.md)

# Allocating extra compute resources for automatic database optimization
Allocating extra compute resources

Autonomics improve query performances on your cluster and help manage storage costs and optimization. You can choose to allocate extra compute resources to ensure that autonomics features run consistently, even during times of high traffic, to benefit from the optimization. Note that autonomics run using these extra resources are billable. For more information on billing for autonomics, see [Billing for autonomics operations](t_autonomics-billing.md) and [Amazon Redshift pricing](https://aws.amazon.com/redshift/pricing/). 

 If extra compute resources for autonomics are disabled, Amazon Redshift temporarily suspends autonomics operations during periods of high system load in order to minimize impact on concurrent workloads, until there are enough resources to run them without negatively impacting user queries, potentially impacting performances. 

## Managing extra compute resources for autonomics


By default, extra compute resources for autonomics are disabled for both provisioned clusters and serverless workgroups, with the exception of serverless workgroups with AI-driven scaling and optimization. For serverless workgroups with AI-driven scaling and optimization, extra compute resources for autonomics are always enabled and managed automatically depending on your price-performance profile.

You can choose to enable extra compute resources both during or after creating the cluster or workgroup.

### Managing extra compute resource for autonomics on provisioned clusters using the Amazon Redshift console


While creating a new cluster, you can enable extra compute resources for autonomics by choosing **Enable extra compute** in the **Autonomics configuration** panel. To do this:
+ Choose **Create cluster**.
+ In the **Autonomics configuration** panel, choose **Enable extra compute**.
+ You will create a cluster with extra compute enabled.

For more information, see [ Creating a cluster](https://docs.aws.amazon.com/redshift/latest/mgmt/create-cluster.html) in the *Amazon Redshift Management Guide*.

To enable extra compute resources after creating a cluster:
+ Navigate to the cluster in the Amazon Redshift console.
+ In the cluster details page, select **Edit autonomics configuration** from the **Actions** drop-down menu.
+ Choose **Enable extra compute**.

### Managing extra compute autonomics for provisioned clusters using the AWS CLI


To create a provisioned cluster with extra compute resources for autonomics, use the `create-cluster` command with the `extra-compute-for-automatic-optimization` option.

```
aws redshift create-cluster --cluster-identifier <value> \
--node-type <value> \
--cluster-type <value> \
--master-username <value> \
--master-user-password <value> \
--extra-compute-for-automatic-optimization \
--region <value>
```

To enable extra compute resources for autonomics on an existing provisioned cluster, use the `modify-cluster` command with the `extra-compute-for-automatic-optimization` option.

```
aws redshift modify-cluster --cluster-identifier <value> \
--extra-compute-for-automatic-optimization \
--region <value>
```

To disable extra compute resources for autonomics on an existing provisioned cluster, use the `modify-cluster` command with the `no-extra-compute-for-automatic-optimization` option.

```
aws redshift modify-cluster --cluster-identifier <value> \
--no-extra-compute-for-automatic-optimization \
--region <value>
```

### Managing extra compute autonomics for serverless workgroups using the Amazon Redshift console


While creating a new workgroup, you can enable extra compute resources for autonomics by choosing **Enable extra compute** in the **Autonomics configuration** panel.
+ Choose **Create workgroup**.
+ At **Step 1**, in the **Autonomics configuration** panel, choose **Enable extra compute**.
+ You will create a serverless workgroup with extra compute enabled.

**Note**  
The **Enable extra compute** option may not be available if you have selected a **Price-performance target**. This is because for serverless workgroups with AI-driven scaling and optimization, extra compute resources for autonomics are automatically enabled and managed based on your price-performance profile.

To enable extra compute resources after creating a workgroup:
+ Navigate to the workgroup in the Amazon Redshift Serverless console.
+ From the workgroup's details page, select **Edit autonomics configuration** from the **Actions** drop-down menu.
+ Choose **Enable extra compute**.

**Note**  
The **Edit autonomics configuration** option may be grayed out if the workgroup has a **Price-performance target** set. This is because for serverless workgroups with AI-driven scaling and optimization, extra compute resources for autonomics are automatically enabled and managed based on your price-performance profile.

### Managing extra compute autonomics for serverless workgroups using the AWS CLI


To create a serverless workgroup with extra compute resources allocated for autonomics, use the `create-workgroup` command with the `extra-compute-for-automatic-optimization` option.

```
aws redshift-serverless create-workgroup --base-capacity <value> \
--namespace-name <value> \
--workgroup-name <value> \
--extra-compute-for-automatic-optimization \
--region <value>
```

To enable extra compute resources for autonomics on an existing serverless workgroup, use the `update-workgroup` command with the `--extra-compute-for-automatic-optimization` option.

```
aws redshift-serverless update-workgroup \
--workgroup-name <value> \
--extra-compute-for-automatic-optimization \
--region <value>
```

To disable extra compute resources for autonomics on an existing serverless workgroup, use the `update-workgroup` command with the `--no-extra-compute-for-automatic-optimization` option.

```
aws redshift-serverless update-workgroup \
--workgroup-name <value> \
--no-extra-compute-for-automatic-optimization \
--region <value>
```

## Cost control for autonomics using extra compute resources


### Cost control for extra compute autonomics on provisioned clusters


You can set usage limits on extra compute resources used for autonomics on provisioned clusters using the Amazon Redshift console. Extra compute resources used for autonomics don't count against any limits you might have set for concurrency scaling and vice versa.

To create a usage limit for extra compute using the console:
+ Navigate to the cluster details page and select the **Maintenance** tab from the cluster navigation menu.
+ Scroll down and click **Create usage limits**, it will navigate to **Manage usage limits** page.
+ On the **Manage usage limits** page, locate the section titled **Usage limit for extra compute for automatic optimization** and select **Add limit**.

To create a usage limit for extra compute using the AWS CLI, use the `create-usage-limit` command with the feature type `extra-compute-for-automatic-optimization`. The `--limit-type` parameter must be set to `time` for this feature type.

```
aws redshift create-usage-limit \
--cluster-identifier <value> \
--feature-type extra-compute-for-automatic-optimization \
--limit-type time \
--period <value> \
--amount <value> \
--breach-action <value>
```

The `--period` and `--breach-action` parameters accept the same values as other usage limits. For more information, see [ Setting a usage limit ](https://docs.aws.amazon.com/redshift/latest/mgmt/rs-mgmt-set-limit-cluster.html) in the *Amazon Redshift Management Guide*.

### Cost control for extra compute autonomics on serverless workgroups


Amazon Redshift Serverless provides capabilities to set usage limits for serverless workgroups, see [ Setting usage limits, including setting RPU limits ](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-workgroup-max-rpu.html) in the *Amazon Redshift Management Guide*. Usage for extra compute autonomics in Amazon Redshift Serverless is included in the overall serverless usage, including user queries.

You can see how many RPU-seconds that your serverless workgroup is using for extra compute autonomics using the Amazon Redshift Serverless console. To do this:
+ Navigate to the **Amazon Redshift Serverless console**.
+ Select **Resource monitoring** from the sidebar.
+ Select a workgroup.
+ Scroll down to the **Extra compute for automatic optimizations charged seconds** graph.

For more information, see [ Amazon Redshift Serverless console ](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-console.html) in the *Amazon Redshift Management Guide*.

You can also check the [SYS\$1SERVERLESS\$1USAGE](SYS_SERVERLESS_USAGE.md) system view to find the `charged_extra_compute_for_automatic_optimization_seconds`, which records accumulated compute unit (RPU) seconds charged for automatic optimizations.

# Billing for autonomics operations
Billing for autonomics operations

By default, Amazon Redshift will not bill you for resources used for autonomics. If you choose to allocate extra compute resources for more consistent autonomics, Amazon Redshift will bill you only for autonomics operations that actually use additional resources, such as concurrency-scaling clusters (or additional RPUs), which are allocated only when main cluster or base RPUs are fully utilized running user workload. For more information, see [Allocating extra compute resources for automatic database optimization](t_extra-compute-autonomics.md) and [Concurrency scaling](concurrency-scaling.md).

## Autonomics billing for provisioned clusters


On provisioned clusters, billing for autonomics operations adheres to the following logic:


| Autonomics operation type | Billing behavior | 
| --- | --- | 
| Amazon Redshift runs an autonomics operation on the main cluster. | Amazon Redshift doesn't bill you for the autonomics operation. | 
| Amazon Redshift runs an autonomics operation on the concurrency-scaling cluster. | Amazon Redshift bills you for the autonomics operation. | 

For more information, see [Amazon Redshift pricing](https://aws.amazon.com/redshift/pricing/).

## Autonomics billing for serverless workgroups


On serverless workgroups, billing for autonomics operations adheres to the following logic: 


| Autonomics operation type | Billing behavior | 
| --- | --- | 
| Amazon Redshift runs a user query and meanwhile finishes an autonomics operation. | Amazon Redshift doesn't bill you for the autonomics operation. | 
| Amazon Redshift has to allocate additional compute capacity for autonomics execution during periods of high system load. | Amazon Redshift bills you for additional compute capacity used on autonomics execution. | 
| Amazon Redshift begins running an autonomics operation while no user queries are running. Amazon Redshift will only do this if you've enabled extra compute resources for autonomics.  | Amazon Redshift bills you for the autonomics operation. | 

You are only billed once for overlapping activity from user or autonomics workload. For example, suppose Amazon Redshift initiates an autonomic operation while no user queries are running, and a user query begins during that operation. In that case, billing is applied once for the interval in which the workgroup is active.

For more information, see [ Billing for Amazon Redshift Serverless ](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-billing.html) in the *Amazon Redshift Management Guide*.

# Usage metrics for autonomics operations
Usage metrics for autonomics operations

If you've enabled extra compute resources for automatic optimizations, you can see information about your billed autonomics usage using the Amazon Redshift console. For more information on autonomics metrics on the console for serverless workgroups, see the resource management section in [ Amazon Redshift Serverless console](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-console.html) in the *Amazon Redshift Management Guide*.

The following system tables hold usage metrics about autonomics:
+ [SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION](SYS_EXTRA_COMPUTE_FOR_AUTOMATIC_OPTIMIZATION.md) ‐ Use SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION to see the amount of time that Amazon Redshift runs provisioned cluster autonomics operations in a given usage period.
+ [SYS\$1AUTOMATIC\$1OPTIMIZATION](SYS_AUTOMATIC_OPTIMIZATION.md) ‐ Use SYS\$1AUTOMATIC\$1OPTIMIZATION to see detailed information on autonomics operations for both provisioned clusters and serverless workgroups.
+ [SYS\$1SERVERLESS\$1USAGE](SYS_SERVERLESS_USAGE.md) ‐ Use SYS\$1SERVERLESS\$1USAGE to see the amount of time that Amazon Redshift runs serverless workgroup autonomics operations in a given usage period.