

 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/). 

# SYS\$1AUTO\$1TABLE\$1OPTIMIZATION
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION"></a>

Records automated actions taken by Amazon Redshift on tables defined for automatic optimization. 

SYS\$1AUTO\$1TABLE\$1OPTIMIZATION is visible only to superusers. For more information, see [Visibility of data in system tables and views](cm_chap_system-tables.md#c_visibility-of-data).

## Table columns
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/r_SYS_AUTO_TABLE_OPTIMIZATION.html)

## Sample queries
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION-sample-queries"></a>

In the following example, the rows in the result show actions taken by Amazon Redshift. 

```
SELECT table_id, alter_table_type, status, event_time, alter_from
FROM SYS_AUTO_TABLE_OPTIMIZATION;
                
 table_id |  alter_table_type   |                        status                        |         event_time          |  alter_from
----------+---------------------+------------------------------------------------------+-----------------------------+-----------------
   118082 | sortkey             | Start                                                | 2020-08-22 19:42:20.727049  | 
   118078 | sortkey             | Start                                                | 2020-08-22 19:43:54.728819  | 
   118082 | sortkey             | Start                                                | 2020-08-22 19:42:52.690264  | 
   118072 | sortkey             | Start                                                | 2020-08-22 19:44:14.793572  | 
   118082 | sortkey             | Failed                                               | 2020-08-22 19:42:20.728917  | 
   118078 | sortkey             | Complete                                             | 2020-08-22 19:43:54.792705  |  SORTKEY: None;
   118086 | sortkey             | Complete                                             | 2020-08-22 19:42:00.72635   |  SORTKEY: None;
   118082 | sortkey             | Complete                                             | 2020-08-22 19:43:34.728144  |  SORTKEY: None;
   118072 | sortkey             | Skipped:Retry exceeds the maximum limit for a table. | 2020-08-22 19:44:46.706155  | 
   118086 | sortkey             | Start                                                | 2020-08-22 19:42:00.685255  | 
   118082 | sortkey             | Start                                                | 2020-08-22 19:43:34.69531   | 
   118072 | sortkey             | Start                                                | 2020-08-22 19:44:46.703331  | 
   118082 | sortkey             | Checkpoint: progress 14.755079%                      | 2020-08-22 19:42:52.692828  | 
   118072 | sortkey             | Failed                                               | 2020-08-22 19:44:14.796071  |   
   116723 | sortkey             | Abort:This table is not AUTO.                        | 2020-10-28 05:12:58.479233  | 
   110203 | distkey             | Abort:This table is not AUTO.                        | 2020-10-28 05:45:54.67259   |
```