ClickHouse/docs/en/operations/system-tables/view_refreshes.md
Michael Kolupaev 538b23d862 Things
2023-12-27 20:24:55 +00:00

3.1 KiB

slug
/en/operations/system-tables/view_refreshes

view_refreshes

Information about Refreshable Materialized Views. Contains all refreshable materialized views, regardless of whether there's a refresh in progress or not.

Columns:

  • database (String) — The name of the database the table is in.
  • view (String) — Table name.
  • status (String) — Current state of the refresh.
  • last_refresh_result (String) — Outcome of the latest refresh attempt.
  • last_refresh_time (DateTime) — Time of the last successful refresh. NULL if no refresh succeeded since server startup or table creation.
  • next_refresh_time (DateTime) — Time at which the next refresh is scheduled to start.
  • remaining_dependencies (Array(String)) — If the view has refresh dependencies, this array contains the subset of those dependencies that are not satisfied for the current refresh yet. If status = 'WaitingForDependencies', a refresh is ready to start as soon as these dependencies are fulfilled.
  • exception (String) — if last_refresh_result = 'Exception', i.e. the last refresh attempt failed, this column contains the corresponding error message and stack trace.
  • refresh_count (UInt64) — Number of successful refreshes since last server restart or table creation.
  • progress (Float64) — Progress of the current refresh, between 0 and 1.
  • read_rows (UInt64) — Number of rows read by the current refresh so far.
  • total_rows (UInt64) — Estimated total number of rows that need to be read by the current refresh.

(There are additional columns related to current refresh progress, but they are currently unreliable.)

Example

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 
└──────────┴────────────────────────────┴───────────┴─────────────────────┴─────────────────────┴─────────────────────┘