> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> System table containing information about Refreshable Materialized Views.

# system.view_refreshes

<Info>
  **Querying in ClickHouse Cloud**

  The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/reference/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.
</Info>

<h2 id="description">
  Description
</h2>

Information about [Refreshable Materialized Views](/reference/statements/create/view#refreshable-materialized-view). Contains all refreshable materialized views, regardless of whether there's a refresh in progress or not.

<h2 id="columns">
  Columns
</h2>

* `database` ([String](/reference/data-types/string)) — The name of the database the table is in.
* `view` ([String](/reference/data-types/string)) — Table name.
* `uuid` ([UUID](/reference/data-types/uuid)) — Table uuid (Atomic database).
* `status` ([String](/reference/data-types/string)) — Current state of the refresh.
* `last_success_time` ([Nullable(DateTime)](/reference/data-types/nullable)) — Time when the latest successful refresh started. NULL if no successful refreshes happened since server startup or table creation.
* `last_success_duration_ms` ([Nullable(UInt64)](/reference/data-types/nullable)) — How long the latest refresh took.
* `last_refresh_time` ([Nullable(DateTime)](/reference/data-types/nullable)) — Time when the latest refresh attempt finished (if known) or started (if unknown or still running). NULL if no refresh attempts happened since server startup or table creation.
* `last_refresh_replica` ([String](/reference/data-types/string)) — If coordination is enabled, name of the replica that made the current (if running) or previous (if not running) refresh attempt.
* `next_refresh_time` ([Nullable(DateTime)](/reference/data-types/nullable)) — Time at which the next refresh is scheduled to start on this replica (unless another replica starts it first). NULL if the next refresh time is not currently known, e.g. when waiting for dependencies (status `WaitingForDependencies` or `MissingDependencies`).
* `exception` ([String](/reference/data-types/string)) — Error message from previous attempt if it failed.
* `retry` ([UInt64](/reference/data-types/int-uint)) — How many failed attempts there were so far, for the current refresh. Not available if status is `RunningOnAnotherReplica`.
* `progress` ([Nullable(Float64)](/reference/data-types/nullable)) — Progress of the current running or most recently completed refresh at the given replica, between 0 and 1. NULL if status is `RunningOnAnotherReplica` or the refresh is not running.
* `read_rows` ([Nullable(UInt64)](/reference/data-types/nullable)) — Number of rows read by the current running or most recently completed refresh at the given replica. NULL if status is `RunningOnAnotherReplica`.
* `read_bytes` ([Nullable(UInt64)](/reference/data-types/nullable)) — Number of bytes read by the current running or most recently completed refresh at the given replica. NULL if status is `RunningOnAnotherReplica`
* `total_rows` ([Nullable(UInt64)](/reference/data-types/nullable)) — Estimated total number of rows that need to be read by the current running or most recently completed refresh at the given replica. NULL if status is `RunningOnAnotherReplica`
* `written_rows` ([Nullable(UInt64)](/reference/data-types/nullable)) — Number of rows written by the current running or most recently completed refresh at the given replica. NULL if status is `RunningOnAnotherReplica`
* `written_bytes` ([Nullable(UInt64)](/reference/data-types/nullable)) — Number of bytes written by the current running or most recently completed refresh at the given replica. NULL if status is `RunningOnAnotherReplica`

<h2 id="example">
  Example
</h2>

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

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