跳转到主要内容
在 ClickHouse Cloud 中查询此系统表中的数据分别保存在 ClickHouse Cloud 各节点的本地。因此,如需查看所有数据的完整情况,需要使用 clusterAllReplicas 函数。更多详情请参见此处

描述

有关可刷新materialized view的信息。包含所有可刷新materialized view,无论当前是否有刷新正在进行。

  • database (String) — 该表所在数据库的名称。
  • view (String) — 表名。
  • uuid (UUID) — 表的 uuid (Atomic 数据库) 。
  • status (String) — 当前刷新状态。
  • last_success_time (Nullable(DateTime)) — 最近一次成功刷新开始的时间。如果自服务器启动或表创建以来从未发生过成功刷新,则为 NULL。
  • last_success_duration_ms (Nullable(UInt64)) — 最近一次刷新的耗时。
  • last_refresh_time (Nullable(DateTime)) — 最近一次刷新尝试完成的时间 (如果已知) ,或其开始时间 (如果未知或仍在运行) 。如果自服务器启动或表创建以来从未发生过刷新尝试,则为 NULL。
  • last_refresh_replica (String) — 如果已启用协调,则表示执行当前 (如果正在运行) 或上一次 (如果未运行) 刷新尝试的副本名称。
  • next_refresh_time (Nullable(DateTime)) — 下一次计划开始刷新的时间,前提是 status = Scheduled。
  • exception (String) — 如果上一次尝试失败,则为其返回的错误消息。
  • retry (UInt64) — 当前刷新截至目前的失败尝试次数。如果 status 为 RunningOnAnotherReplica,则不可用。
  • progress (Nullable(Float64)) — 给定副本上当前正在运行或最近一次完成的刷新的进度,介于 0 到 1 之间。如果 status 为 RunningOnAnotherReplica 或刷新未在运行,则为 NULL。
  • read_rows (Nullable(UInt64)) — 给定副本上当前正在运行或最近一次完成的刷新读取的行数。如果 status 为 RunningOnAnotherReplica,则为 NULL。
  • read_bytes (Nullable(UInt64)) — 给定副本上当前正在运行或最近一次完成的刷新读取的字节数。如果 status 为 RunningOnAnotherReplica,则为 NULL
  • total_rows (Nullable(UInt64)) — 给定副本上当前正在运行或最近一次完成的刷新预计需要读取的总行数。如果 status 为 RunningOnAnotherReplica,则为 NULL
  • written_rows (Nullable(UInt64)) — 给定副本上当前正在运行或最近一次完成的刷新写入的行数。如果 status 为 RunningOnAnotherReplica,则为 NULL
  • written_bytes (Nullable(UInt64)) — 给定副本上当前正在运行或最近一次完成的刷新写入的字节数。如果 status 为 RunningOnAnotherReplica,则为 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:002023-12-01 01:25:00
└──────────┴────────────────────────────┴───────────┴─────────────────────┴─────────────────────┴─────────────────────┘
最后修改于 2026年6月10日