Account Usage¶
In the SNOWFLAKE database, the ACCOUNT_USAGE and READER_ACCOUNT_USAGE schemas enable querying object metadata, as well as historical usage data, for your account and all reader accounts (if any) associated with the account.
Overview of Account Usage schemas¶
- ACCOUNT_USAGE:
Views that display object metadata and usage metrics for your account.
In general, these views mirror the corresponding views and table functions in the Snowflake Snowflake Information Schema, but with the following differences:
- Records for dropped objects are included in each view.
- Longer retention time for historical usage data.
- Data latency.
For more details, see Differences Between Account Usage and Information Schema (in this topic). For more details about each view, see ACCOUNT_USAGE Views (in this topic).
- READER_ACCOUNT_USAGE:
Views that display object metadata and usage metrics for all the reader accounts that have been created for your account (as a Secure Data Sharing provider).
These views are a small subset of the ACCOUNT_USAGE views that apply to reader accounts. Also, each view in this schema contains an additional
READER_ACCOUNT_NAMEcolumn for filtering results by reader account.For more details about each view, see READER_ACCOUNT_USAGE Views (in this topic).
Note that these views are empty if no reader accounts have been created for your account.
Differences between Account Usage and Information Schema¶
The Account Usage views and the corresponding views (or table functions) in the Snowflake Information Schema utilize identical structures and naming conventions, but with some key differences, as described in this section:
| Difference | Account Usage | Information Schema |
|---|---|---|
| Includes dropped objects | Yes | No |
| Latency of data | From 45 minutes to 3 hours (varies by view) | None |
| Retention of historical data | 1 year | From 7 days to 6 months (varies by view/table function) |
For more details, see the following sections.
Dropped object records¶
Account usage views include records for all objects that have been dropped. Many of the views for object types contain an
additional DELETED column that displays the timestamp when the object was dropped.
In addition, because objects can be dropped and recreated with the same name, to differentiate between object records that have the same name, the account usage views include ID columns, where appropriate, that display the internal IDs generated and assigned to each record by the system.
If a column for an object name (for example, the TABLE_NAME column) is NULL, that object has been dropped. In this case, the
columns for the names and IDs of the parent objects (for example, the DATABASE_NAME and SCHEMA_NAME columns) are also
NULL.
Note that in some views, the column for the object name might still contain the name of the object, even if the object has been dropped.
Data latency¶
Due to the process of extracting the data from Snowflake’s internal metadata store, the account usage views have some natural latency:
- For most of the views, the latency is 2 hours (120 minutes).
- For the remaining views, the latency varies between 45 minutes and 3 hours.
For details, see the list of views for each schema (in this topic). Also, note that these are all maximum time lengths; the actual latency for a given view when the view is queried may be less.
In contrast, views/table functions in the Snowflake Information Schema do not have any latency.
Historical data retention¶
Certain account usage views provide historical usage metrics. The retention period for these views is 1 year (365 days).
In contrast, the corresponding views and table functions in the Snowflake Information Schema have much shorter retention periods, ranging from 7 days to 6 months, depending on the view.
ACCOUNT_ USAGE views¶
The ACCOUNT_USAGE schema contains the following views:
| View | Type | Latency [1] | Edition [3] | Notes |
|---|---|---|---|---|
| ACCESS_HISTORY | Historical | 3 hours | Enterprise Edition (or higher) | Data retained for 1 year. |
| AGGREGATE_ACCESS_HISTORY | Historical | 3 hours | Enterprise Edition (or higher) | Data retained for 1 year. |
| AGGREGATE_QUERY_HISTORY | Historical | 3 hours | ||
| AGGREGATION_POLICIES | Object | 2 hours | ||
| AI_GATEWAY_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| ALERT_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| ANOMALIES_DAILY | Historical | 3 hours | Data retained for 1 year. | |
| APPLICATION_CALLBACK_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| APPLICATION_CONFIGURATIONS | Object | 3 hours | Data retained for 1 year. | |
| APPLICATION_CONFIGURATION_VALUE_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| APPLICATION_DAILY_USAGE_HISTORY | Historical | 24 hours | Data retained for 1 year. | |
| APPLICATION_REMOTE_OPERATION_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| APPLICATION_SPECIFICATION_STATUS_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| APPLICATION_SPECIFICATIONS | Historical | 1 hour | Data for deleted app specifications is retained for 1 year. | |
| ARCHIVE_STORAGE_DATA_RETRIEVAL_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| AUTOMATIC_CLUSTERING_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| BACKUP_OPERATION_HISTORY | Historical | 6 hours | Data retained for 1 year. | |
| BACKUP_POLICIES | Object | 6 hours | ||
| BACKUP_SETS | Object | 6 hours | ||
| BACKUP_STORAGE_USAGE | Historical | 6 hours | Data retained for 1 year. | |
| BACKUPS | Object | 6 hours | ||
| BLOCK_STORAGE_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| BLOCK_STORAGE_SNAPSHOTS | Object | 3 hours | ||
| CATALOG_LINKED_DATABASE_USAGE_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| CLASS_INSTANCES | Object | 3 hours | Data retained for 1 year. | |
| CLASSES | Object | 3 hours | Data retained for 1 year. | |
| COLUMN_QUERY_PRUNING_HISTORY | Historical | 4 hours | Data retained for 1 year. | |
| COLUMNS | Object | 90 minutes | ||
| COMPLETE_TASK_GRAPHS | Historical | 45 minutes | Data retained for 1 year. | |
| COMPUTE_POOLS | Historical | 3 hours | Data retained for 1 year. | |
| CONTACT_REFERENCES | Object | 3 hours | ||
| CONTACTS | Object | 3 hours | ||
| COPY_FILES_HISTORY | Historical | Data retained for 1 year. | ||
| COPY_HISTORY | Historical | 2 hours [2] | Data retained for 1 year. | |
| CORTEX_AGENT_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_AI_FUNCTIONS_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_AI_GUARDRAILS_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_AISQL_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_CODE_CLI_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_CODE_SNOWSIGHT_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_ANALYST_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_DOCUMENT_PROCESSING_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_FINE_TUNING_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_FUNCTIONS_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_PROVISIONED_THROUGHPUT_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_REST_API_RATE_LIMIT_POLICIES | Object | 6 hours | ||
| CORTEX_REST_API_USAGE_HISTORY | Historical | Data retained for 1 year. | ||
| CORTEX_SEARCH_BATCH_QUERY_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CORTEX_SEARCH_DAILY_USAGE_HISTORY | Historical | 3 hours | Data retained for 1 year. | |
| CORTEX_SEARCH_SERVING_USAGE_HISTORY | Historical | 1 hour | Data retained for 1 year. | |
| CREDENTIALS | Object | 2 hours | ||
| DATA_CLASSIFICATION_HISTORY | Historical | 3 hours | Enterprise Edition (or higher) | Data retained for 1 year. |
| DATA_CLASSIFICATION_LATEST | Object | 3 hours | Enterprise Edition (or higher) | Data retained for as long as the table exists. |
| DATA_METRIC_FUNCTION_EXPECTATIONS | Object | 30 minutes | Enterprise Edition (or higher) | |
| DATA_METRIC_FUNCTION_REFERENCES | Object | 3 hours | Enterprise Edition (or higher) | |
| DATA_MOVEMENT_POLICIES | Object | 2 hours | ||