Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
SVV_MV_INFO
The SVV_MV_INFO table has one row for every materialized view. It contains information about the staleness of the data in the materialized view and the state of the materialized view.
For more information about materialized views, see Materialized views in Amazon Redshift.
SVV_MV_INFO is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of data in system tables and views.
Table columns
| Column name | Data type | Description |
|---|---|---|
| database_name | char(128) | The database that contains the materialized view. |
| schema_name | char(128) | The schema of the database. |
| user_name | char(128) | The user who owns the materialized view. |
| name | char(128) | The materialized view name. |
| is_stale | char(1) | A t indicates that the materialized view is stale. A stale materialized view is one where the base tables have been updated but the materialized view hasn't been refreshed. An f indicates that the materialized view is up-to-date with the base table changes. A u indicates unknown staleness (for example, in case of MVs on plain external tables). This information
might not be accurate if a refresh hasn't been run since the
last restart. |
| state | integer | The state of the materialized view as follows:
|
| autorewrite | char(1) | A t indicates that the materialized
view is eligible for automatic rewriting of queries. |
| autorefresh | char(1) | Specifies whether Auto Refresh is enabled for the materialized view. |
| autorefresh_interval | int | The Auto Refresh interval, in seconds, configured
for the materialized view. Materialized views that don't
support user-defined refresh intervals have a value of
NULL. |
| has_default_autorefresh_interval | char(1) | Specifies whether the materialized
view uses the cluster-wide default Auto Refresh interval. Materialized views
that don't support user-defined refresh intervals show
f. |
Sample query
To view the state of all materialized views, run the following query.
select * from svv_mv_info;
This query returns the following sample output.
database_name | schema_name | user_name | name | is_stale | state | autorewrite | autorefresh | autorefresh_interval | has_default_autorefresh_interval ---------------+-------------+-----------+--------------------+----------+-------+-------------+-------------+----------------------+---------------------------------- dev | public | reg | customers | t | 1 | t | f | | f dev | public | reg | dashboard_partsupp | t | 1 | t | t | 86400 | f dev | public | reg | dashboard_sales | f | 1 | t | t | 300 | t