MATERIALIZED_VIEW_REFRESH_HISTORY

functionsupportedTables, views, streams, sequencesEnterprise+

docs.snowflake.com ↗

Information SchemaTable functions

This table function is used for querying the materialized views refresh history for a specified materialized view within a specified date range. The information returned by the function includes the view name and credits consumed each time a materialized view is refreshed. Note This function is generally deprecated in favor of the ACCOUNT_USAGE.MATERIALIZED_VIEW_REFRESH_HISTORY view, which provides a more complete data set and supports longer date ranges. Materialized views require Enterprise Edition. To inquire about upgrading, please contact Snowflake Support.

Syntax

supportedpartialnot supportednot scored

MATERIALIZED_VIEW_REFRESH_HISTORY(
      [ DATE_RANGE_START => <constant_expr> ]
      [ , DATE_RANGE_END => <constant_expr> ]
      [ , MATERIALIZED_VIEW_NAME => '<string>' ] )

Parameters

NameRequiredDescription
DATE_RANGE_START => constant_expr , DATE_RANGE_END => constant_exprrequiredThe date/time range to display the materialized view maintenance history. For example, if you specify that the start date is 2019-04-03 and the end date is 2019-04-05, then you get data for April 3, April 4, and April 5. (The endpoints are included.) If neither a start date nor an end date is specified, the default will be the last 12 hours. If an end date is not specified, but a start date is specified, then CURRENT_DATE at midnight is used as the end of the range. If a start date is not specified, but an end date is specified, then the range starts 12 hours prior to the start of DATE_RANGE_END.
MATERIALIZED_VIEW_NAME => stringrequiredMaterialized view name. If specified, only shows the history for the specified materialized view. The name can include the schema name and the database name. If a name is not specified, then the results includes the data for each materialized view maintained within the specified time range.

Usage notes

Output

The function returns one row per materialized view for each 1-hour window, within the queried date range, in which that view consumed refresh credits. A materialized view that had no refresh activity during a given hour doesn’t produce a row for that hour, so the absence of a row implies zero credits used, not zero reported as a value. The function returns the following columns: Column Name | Data Type | Description START_TIME | TIMESTAMP_LTZ | Start of the 1-hour window (see the Usage notes above) that this row’s credit usage is attributed to. This is a bucket boundary within the queried date range, not the DATE_RANGE_START argument. END_TIME | TIMESTAMP_LTZ | End of the 1-hour window that this row’s credit usage is attributed to. This is a bucket boundary within the queried date range, not the DATE_RANGE_END argument. CREDITS_USED | TEXT | Number of credits billed for this materialized view’s maintenance during the START_TIME and END_TIME window. This value is per materialized view, per 1-hour window, and can be fractional. MATERIALIZED_VIEW_NAME | TEXT | Fully-qualified name (database.schema.view) of the materialized view.