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 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 objects 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 (e.g. 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 (e.g. 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 |
|---|---|---|---|---|
Historical |
3 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Historical |
3 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Historical |
3 hours |
|||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
24 hours |
Data retained for 1 year. |
||
Historical |
1 hour |
Data retained for 1 year. |
||
Historical |
1 hour |
Data for deleted app specifications is retained for 1 year. |
||
Historical |
1 hour |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
6 hours |
Data retained for 1 year. |
||
Object |
6 hours |
|||
Object |
6 hours |
|||
Historical |
6 hours |
Data retained for 1 year. |
||
Object |
6 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
Data retained for 1 year. |
||
Historical |
4 hours |
Data retained for 1 year. |
||
Object |
90 minutes |
|||
Historical |
45 minutes |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
|||
Object |
3 hours |
|||
Historical |
Data retained for 1 year. |
|||
Historical |
2 hours [2] |
Data retained for 1 year. |
||
Historical |
Data retained for 1 year. |
|||
Historical |
Data retained for 1 year. |
|||
Historical |
Data retained for 1 year. |
|||
Historical |
One hour |
Data retained for 1 year. |
||
Historical |
1 hour |
Data retained for 1 year. |
||
Historical |
1 hour |
Data retained for 1 year. |
||
Historical |
Data retained for 1 year. |
|||
Historical |
Data retained for 1 year. |
|||
Historical |
Data retained for 1 year. |
|||
Historical |
Data retained for 1 year. |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
1 hour |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Object |
3 hours |
Enterprise Edition (or higher) |
Data retained for as long as the table exists. |
|
Object |
30 minutes |
Enterprise Edition (or higher) |
||
Object |
3 hours |
Enterprise Edition (or higher) |
||
Historical |
3 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Object |
3 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
2 hours |
Data retained for 1 year. |
||
Historical |
Data retained for 1 year. |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
90 minutes |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
2 hours |
Data retained for 1 year. |
||
Object |
90 minutes |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
3 hours |
|||
Object |
2 hours |
|||
Object |
3 hours |
|||
Historical |
3 hours |
Data retained for 1 year. (As of March 1, 2026, hybrid table requests are no longer billed.) |
||
Historical |
2 hours |
Data retained for 1 year. |
||
Object |
3 hours |
|||
Object |
3 hours |
|||
Historical |
4 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
|||
Historical |
6 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Object |
3 hours |
|||
Historical |
90 minutes [2] |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
2 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Historical |
3 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Historical |
3 hours |
|||
Historical |
3 hours |
|||
Historical |
3 hours |
|||
Historical |
3 hours |
|||
Historical |
3 hours |
|||
Object |
2 hours |
Business Critical (or higher) |
Data for deleted endpoints is retained for 1 year. |
|
Object |
2 hours |
|||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
24 hours |
Enterprise Edition (or higher) |
||
Object |
2 hours |
Enterprise Edition (or higher) |
||
Object |
2 hours |
|||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Historical |
8 hours |
Data retained for 1 year. |
||
Historical |
45 minutes |
Data retained for 1 year. |
||
Historical |
Data retained for 1 year. |
|||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Historical |
6 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Historical |
3 hours |
Enterprise Edition (or higher) |
Data retained for 1 year. |
|
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
|||
Object |
2 hours |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Object |
3 hours |
|||
Historical |
6 hours |
Data retained for 1 year. This view is deprecated. Use the BACKUP_OPERATION_HISTORY view instead. |
||
Object |
6 hours |
This view is deprecated. Use the BACKUP_POLICIES view instead. |
||
Object |
6 hours |
This view is deprecated. Use the BACKUP_SETS view instead. |
||
Historical |
6 hours |
Data retained for 1 year. This view is deprecated. Use the BACKUP_STORAGE_USAGE view instead. |
||
Object |
6 hours |
This view is deprecated. Use the BACKUPS view instead. |
||
Historical |
Data retained for 1 year. |
|||
Historical |
3 hour |
Data retained for 1 year. |
||
Historical |
||||
Historical |
2 hours |
Data retained for 1 year. |
||
Historical |
12 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Historical |
2 hours |
Data retained for 1 year. |
||
Object |
2 hours |
|||
Historical |
2 hours |
Data retained for 1 year. |
||
Historical |
2 hours |
Combined usage across all database tables and internal stages. Data retained for 1 year. |
||
Object |
90 minutes |
|||
Object |
2 hours |
|||
Historical |
6 hours |
Data retained for 1 year. |
||
Historical |
6 hours |
Data retained for 1 year. |
||
Historical |
4 hours |
Data retained for 1 year. |
||
Object |
90 minutes |
|||
Object |
2 hours |
|||
Object |
2 hours |
|||
Historical |
45 minutes |
|||
Object |
3 hours |
|||
Historical |
1 hour |
|||
Object |
2 hours |
|||
Object |
90 minutes |
|||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
||
Historical |
3 hours |
Data retained for 1 year. |
[1] All latency times are approximate; in some instances, the actual latency may be lower.
[2] The latency of the views for a given table may be up to 2 days if both of the following conditions are true: 1. Fewer than 32 DML statements have been added to the given table since it was last updated in LOAD_HISTORY or COPY_HISTORY. 2. Fewer than 100 rows have been added to the given table since it was last updated in LOAD_HISTORY or COPY_HISTORY.
[3] Unless otherwise noted, the Account Usage view is available to all accounts.
Account Usage table functions¶
Currently, Snowflake supports one ACCOUNT_USAGE table function:
Table Function |
Data Retention |
Notes |
|---|---|---|
N/A |
Results are only returned for the role that has access to the specified object. |
Note
Similar to the Account Usage views, please account for latency when calling this table function. The expected latency for this table function is similar to the latency for the TAG_REFERENCES view.
READER_ACCOUNT_USAGE views¶
The READER_ACCOUNT_USAGE schema contains the following views:
View |
Type |
Latency [1] |
Notes |
|---|---|---|---|
Historical |
2 hours |
Data retained for 1 year. |
|
Historical |
45 minutes |
Data retained for 1 year. |
|
Object |
2 hours |
||
Historical |
24 hours |
Combined usage across all database tables and internal stages. Data retained for 1 year. |
|
Historical |
24 hours |
Data retained for 1 year. |
[1] All latency times are approximate; in some instances, the actual latency may be lower.
Enabling other roles to use schemas in the SNOWFLAKE database¶
By default, the SNOWFLAKE database is visible to all users; however, access to schemas in this database can be granted by a user with the ACCOUNTADMIN role using either of the following approaches:
Grant IMPORTED PRIVILEGES on the SNOWFLAKE database.
Grant a SNOWFLAKE database role to an account role.
Important
To avoid unintentionally granting access to organization-level data, consider using SNOWFLAKE database roles to grant access to views in the ACCOUNT_USAGE schema.
For more information, refer to GRANT DATABASE ROLE.
For example, to grant IMPORTED PRIVILEGES on the SNOWFLAKE database to two additional roles:
A user with that is granted the customrole1 role can query a view as follows:
For additional examples, see Querying the Account Usage views.
ACCOUNT_USAGE schema SNOWFLAKE database roles¶
In addition, you can grant finer control to accounts using SNOWFLAKE Database roles. For more information on database roles, see database roles.
ACCOUNT_USAGE schemas have four defined SNOWFLAKE database roles, each granted the SELECT privilege on specific views.
Role |
Purpose and Description |
|---|---|
OBJECT_VIEWER |
The OBJECT_VIEWER role provides visibility into object metadata. |
USAGE_VIEWER |
The USAGE_VIEWER role provides visibility into historical usage information. |
GOVERNANCE_VIEWER |
The GOVERNANCE_VIEWER role provides visibility into data governance related information. |
SECURITY_VIEWER |
The SECURITY_VIEWER role provides visibility into security based information. |
Database role required to access ACCOUNT_USAGE views¶
The OBJECT_VIEWER, USAGE_VIEWER, GOVERNANCE_VIEWER, and SECURITY_VIEWER roles have the SELECT privilege to query Account Usage views in the shared SNOWFLAKE database. Use the following table to determine which database role has access to a view.
View |
Database Role |
|---|---|
GOVERNANCE_VIEWER |
|
SECURITY_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
GOVERNANCE_VIEWER |
|
USAGE_VIEWER or GOVERNANCE_VIEWER |
|
USAGE_VIEWER or GOVERNANCE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
GOVERNANCE_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
GOVERNANCE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
GOVERNANCE_VIEWER, SECURITY_VIEWER |
|
USAGE_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
OBJECT_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
USAGE_VIEWER, GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
SECURITY_VIEWER |
|
GOVERNANCE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
GOVERNANCE_VIEWER |
|
GOVERNANCE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
OBJECT_VIEWER |
|
GOVERNANCE_VIEWER |
|
OBJECT_VIEWER or GOVERNANCE_VIEWER |
|
USAGE_VIEWER |
|
SECURITY_VIEWER |
|
SECURITY_VIEWER |
|
OBJECT_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
|
USAGE_VIEWER |
READER_ACCOUNT_USAGE schema SNOWFLAKE database roles¶
The READER_USAGE_VIEWER SNOWFLAKE database role is granted SELECT privilege on all READER_ACCOUNT_USAGE views. As reader accounts are created by clients, the READER_USAGE_VIEWER role is expected to be granted to those roles used to monitor reader account use.
Querying the Account Usage views¶
This section includes considerations when querying the Account Usage views along with query examples.
Selecting columns¶
The Snowflake-specific views are subject to change. Avoid selecting all columns from these views. Instead, select the columns that you want.
For example, if you want the name column, use SELECT name, rather than SELECT *.
Reconciling cost views¶
There are several Account Usage views that contain data related to the cost of compute resources, storage, and data transfers. If you are trying to reconcile these views against a corresponding view in the ORGANIZATION_USAGE schema, you must first set the timezone of the session to UTC.
For example, if you are trying to reconcile ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY to the account’s data in ORGANIZATION_USAGE.WAREHOUSE_METERING_HISTORY, you must run the following command before querying the Account Usage view:
Examples¶
The following examples show some typical/useful queries using the views in the ACCOUNT_USAGE schema.
Note
These examples assume the SNOWFLAKE database and the ACCOUNT_USAGE schema are in use for the current session. The examples also assume the ACCOUNTADMIN role (or a role granted IMPORTED PRIVILEGES on the database) is in use. If they are not in use, execute the following commands before running the queries in the examples:
Examples: User login metrics¶
Average number of seconds between failed login attempts by user (month-to-date):
Failed logins by user (month-to-date):
Failed logins by user and connecting client (month-to-date):
Examples: Warehouse performance¶
This query calculates virtual warehouse performance metrics such as throughput and latency for 15-minute time intervals over the course of one day.
In the code sample below, you can replace CURRENT_WAREHOUSE() with the name of a warehouse to calculate metrics for that warehouse. In
addition, change the time_from and time_to dates in the WITH clause to specify the time period.
Note
Analyze different statement types separately (e.g., SELECT statements independent of INSERT or DELETE or other statements).
The NUMJOBS value represents the throughput for that time interval.
The P50_TOTAL_DURATION (median) and P95_TOTAL_DURATION (peak) values represent latency.
The SUM_TOTAL_DURATION is the sum of the SUM_<job_stage>_TIME values for the different job stages (COMPILATION_AND_SCHEDULING, QUEUED, BLOCKED, EXECUTION).
Analyze the <job_stage>_RATIO values when the load (NUMJOBS) increases. Look for ratio changes or deviations from the average.
If the QUEUED_RATIO is high, there might not be sufficient capacity in the warehouse. Add more clusters or increase the warehouse size.
Examples: Warehouse credit usage¶
Credits used by each warehouse in your account (month-to-date):
Credits used over time by each warehouse in your account (month-to-date):
Examples: Data storage usage¶
Billable terabytes stored in your account over time:
Examples: User query totals and execution times¶
Total jobs executed in your account (month-to-date):
Total jobs executed by each warehouse in your account (month-to-date):
Average query execution time by user (month-to-date):
Average query execution time by query type and warehouse size (month-to-date):
Examples: Obtain a query count for every login event¶
Join columns from LOGIN_HISTORY, QUERY_HISTORY, and SESSIONS to obtain a query count for each user login event.
Note
The SESSIONS view records information starting on July 20-21, 2020, therefore the query result will only contain overlapping information for each of the three views starting from this date.