

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# SYS\$1MV\$1REFRESH\$1HISTORY
<a name="SYS_MV_REFRESH_HISTORY"></a>

結果には、すべてのマテリアライズドビューの更新履歴に関する情報が含まれます。結果には、手動や自動などの更新タイプ、および最新の更新のステータスが含まれます。

SYS\$1MV\$1REFRESH\$1HISTORY はすべてのユーザーに表示されます。スーパーユーザーはすべての行を表示できますが、通常のユーザーは自分のデータのみを表示できます。詳細については、「[システムテーブルとビューのデータの可視性](cm_chap_system-tables.md#c_visibility-of-data)」を参照してください。

## テーブルの列
<a name="SYS_MV_REFRESH_HISTORY-table-columns"></a>

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

## サンプルクエリ
<a name="SYS_MV_REFRESH_HISTORY-sample-queries"></a>

次のクエリは、マテリアライズドビューの更新履歴を表示します。

```
SELECT user_id, 
     session_id, 
     transaction_id, 
     database_name, 
     schema_name, 
     mv_id, 
     mv_name,
     refresh_type,
     status,
     start_time,
     end_time,
     duration,
     consumer_account,
     consumer_region,
     consumer_namespace
     from sys_mv_refresh_history;
```

このクエリは、次のサンプル出力を返します。

```
 user_id | session_id | transaction_id | database_name | schema_name                | mv_id  |  mv_name           |  refresh_type  |  status                                                                                              |  start_time                |  end_time                  |  duration | consumer_account | consumer_region | consumer_namespace
---------+------------+----------------+---------------+----------------------------+--------+--------------------+----------------+------------------------------------------------------------------------------------------------------+----------------------------+----------------------------+-----------+------------------+-----------------+------------------------------------
       1 | 1073815659 |          15066 | dev           | test_stl_mv_refresh_schema | 203762 | mv_incremental     | Manual         | MV was already updated                                                                               | 2023-10-26 15:59:20.952179 | 2023-10-26 15:59:20.952866 |      687 |                  |                 |
       1 | 1073815659 |          15068 | dev           | test_stl_mv_refresh_schema | 203771 | mv_nonincremental  | Manual         | MV was already updated                                                                               | 2023-10-26 15:59:21.008049 | 2023-10-26 15:59:21.008658 |      609 |                  |                 |
       1 | 1073815659 |          15070 | ext_db        | producer_schema            | 203779 | producer_mv        | Manual         | Refresh successfully updated MV incrementally                                                        | 2023-10-26 15:59:21.064252 | 2023-10-26 15:59:21.064885 |      633 | 0123456789       | us-east-1       | 623d8ff2-4391-4381-83d7-177caa6767af
       1 | 1073815659 |          15074 | dev           | test_stl_mv_refresh_schema | 203762 | mv_incremental     | Manual         | Refresh successfully updated MV incrementally                                                        | 2023-10-26 15:59:29.693329 | 2023-10-26 15:59:43.482842 | 13789513 |                  |                 |
       1 | 1073815659 |          15076 | dev           | test_stl_mv_refresh_schema | 203771 | mv_nonincremental  | Manual         | Refresh successfully recomputed MV from scratch                                                      | 2023-10-26 15:59:43.550184 | 2023-10-26 15:59:47.880833 |  4330649 |                  |                 |
       1 | 1073815659 |          15078 | dev           | test_stl_mv_refresh_schema | 203779 | mv_refresh_error   | Manual         | Refresh failed due to an internal error                                                              | 2023-10-26 15:59:47.949052 | 2023-10-26 15:59:52.494681 |  4545629 |                  |                 |
       1 | 1073815659 |          15071 | dev           | test_stl_mv_refresh_schema | 203778 | mv_test            | Manual         | Cascade refresh failed because materialized view test_stl_mv_refresh_schema.child was not refreshed. | 2023-10-26 15:30:21.432252 | 2023-10-26 15:30:21.432252 |      532 |                  |                 |
       1 | 1073815659 |          15071 | dev           | test_stl_mv_refresh_schema | 203761 | child              | Manual         | Refresh failed due to an internal error.                                                             | 2023-10-26 15:30:21.432252 | 2023-10-26 15:30:21.432252 |      532 |                  |                 |
       1 | 1073815659 |          15069 | dev           | test_stl_mv_refresh_schema | 203778 | mv_test            | Manual         | Cascade refresh skipped because materialized view test_stl_mv_refresh_schema.child was not refreshed.| 2023-10-26 15:21:43.550369 | 2023-10-26 15:21:43.550369 |      633
       1 | 1073815659 |          15069 | dev           | test_stl_mv_refresh_schema | 203761 | child              | Manual         | Refresh failed due to an internal error.                                                             | 2023-10-26 15:21:43.550369 | 2023-10-26 15:21:43.550369 |      633
(10 rows)
```