> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 包含 可刷新materialized view 信息的系统表。

# system.view_refreshes

<Info>
  **在 ClickHouse Cloud 中查询**

  此系统表中的数据分别保存在 ClickHouse Cloud 各节点的本地。因此，如需查看所有数据的完整情况，需要使用 `clusterAllReplicas` 函数。更多详情请参见[此处](/zh/reference/system-tables/overview#system-tables-in-clickhouse-cloud)。
</Info>

<div id="description">
  ## 描述
</div>

有关[可刷新materialized view](/zh/reference/statements/create/view#refreshable-materialized-view)的信息。包含所有可刷新materialized view，无论当前是否有刷新正在进行。

<div id="columns">
  ## 列
</div>

* `database` ([String](/zh/reference/data-types)) — 该表所在数据库的名称。
* `view` ([String](/zh/reference/data-types)) — 表名。
* `uuid` ([UUID](/zh/reference/data-types)) — 表的 uuid (Atomic 数据库) 。
* `status` ([String](/zh/reference/data-types)) — 当前刷新状态。
* `last_success_time` ([Nullable(DateTime)](/zh/reference/data-types)) — 最近一次成功刷新开始的时间。如果自服务器启动或表创建以来从未发生过成功刷新，则为 NULL。
* `last_success_duration_ms` ([Nullable(UInt64)](/zh/reference/data-types)) — 最近一次刷新的耗时。
* `last_refresh_time` ([Nullable(DateTime)](/zh/reference/data-types)) — 最近一次刷新尝试完成的时间 (如果已知) ，或其开始时间 (如果未知或仍在运行) 。如果自服务器启动或表创建以来从未发生过刷新尝试，则为 NULL。
* `last_refresh_replica` ([String](/zh/reference/data-types)) — 如果已启用协调，则表示执行当前 (如果正在运行) 或上一次 (如果未运行) 刷新尝试的副本名称。
* `next_refresh_time` ([Nullable(DateTime)](/zh/reference/data-types)) — 下一次计划开始刷新的时间，前提是 status = Scheduled。
* `exception` ([String](/zh/reference/data-types)) — 如果上一次尝试失败，则为其返回的错误消息。
* `retry` ([UInt64](/zh/reference/data-types)) — 当前刷新截至目前的失败尝试次数。如果 status 为 `RunningOnAnotherReplica`，则不可用。
* `progress` ([Nullable(Float64)](/zh/reference/data-types)) — 给定副本上当前正在运行或最近一次完成的刷新的进度，介于 0 到 1 之间。如果 status 为 `RunningOnAnotherReplica` 或刷新未在运行，则为 NULL。
* `read_rows` ([Nullable(UInt64)](/zh/reference/data-types)) — 给定副本上当前正在运行或最近一次完成的刷新读取的行数。如果 status 为 `RunningOnAnotherReplica`，则为 NULL。
* `read_bytes` ([Nullable(UInt64)](/zh/reference/data-types)) — 给定副本上当前正在运行或最近一次完成的刷新读取的字节数。如果 status 为 `RunningOnAnotherReplica`，则为 NULL
* `total_rows` ([Nullable(UInt64)](/zh/reference/data-types)) — 给定副本上当前正在运行或最近一次完成的刷新预计需要读取的总行数。如果 status 为 `RunningOnAnotherReplica`，则为 NULL
* `written_rows` ([Nullable(UInt64)](/zh/reference/data-types)) — 给定副本上当前正在运行或最近一次完成的刷新写入的行数。如果 status 为 `RunningOnAnotherReplica`，则为 NULL
* `written_bytes` ([Nullable(UInt64)](/zh/reference/data-types)) — 给定副本上当前正在运行或最近一次完成的刷新写入的字节数。如果 status 为 `RunningOnAnotherReplica`，则为 NULL

<div id="example">
  ## 示例
</div>

```sql theme={null}
SELECT
    database,
    view,
    status,
    last_refresh_result,
    last_refresh_time,
    next_refresh_time
FROM system.view_refreshes

┌─database─┬─view───────────────────────┬─status────┬─last_refresh_result─┬───last_refresh_time─┬───next_refresh_time─┐
│ default  │ hello_documentation_reader │ Scheduled │ Finished            │ 2023-12-01 01:24:00 │ 2023-12-01 01:25:00 │
└──────────┴────────────────────────────┴───────────┴─────────────────────┴─────────────────────┴─────────────────────┘
```
