- Schema:
For guidance on query performance when using organization-wide usage views, see Performance (Organization Usage).
QUERY_ INSIGHTS view¶
Important
This view is only available in the organization account. For more information, see Premium views in the organization account.
Organization Usage performance
When you query a specific view in the SNOWFLAKE.ORGANIZATION_USAGE schema, follow the organization-wide guidance in
Performance (Organization Usage): bound every scan on history views, list
columns explicitly, and use the time filter column table plus worked SQL and anti-patterns there.
This Organization Usage view displays a row for each insight produced for a query across the accounts in your organization. It contains the same data as the QUERY_INSIGHTS view in the ACCOUNT_USAGE schema, additionally aggregated at the organization level.
This view is available only in the organization account. Users with the GLOBALORGADMIN role, or users granted the SNOWFLAKE.ORGANIZATION_GOVERNANCE_VIEWER application role, can access it. For details, see Accessing the ORGANIZATION_USAGE schema.
Columns¶
Organization-level columns
| Column Name | Data Type | Description |
|---|---|---|
| ORGANIZATION_NAME | VARCHAR | Name of the organization. |
| ACCOUNT_LOCATOR | VARCHAR | System-generated identifier for the account. |
| ACCOUNT_NAME | VARCHAR | User-defined identifier for the account. |
Additional columns
| Column Name | Data Type | Description |
|---|---|---|
| START_TIME | TIMESTAMP_LTZ | Start time of the query. |
| END_TIME | TIMESTAMP_LTZ | End time of the query. |
| TOTAL_ELAPSED_TIME | NUMBER | Total elapsed time of the query (in milliseconds). |
| QUERY_ID | VARCHAR | Internal/system-generated identifier for the SQL statement. |
| QUERY_HASH | VARCHAR | The hash value computed based on the canonicalized SQL text. |
| QUERY_PARAMETERIZED_HASH | VARCHAR | The hash value computed based on the parameterized query. |
| WAREHOUSE_ID | VARCHAR | Internal/system-generated identifier for the warehouse that was used. |
| WAREHOUSE_NAME | VARCHAR | Warehouse that the query executed on, if any. |
| INSIGHT_INSTANCE_ID | NUMBER | Internal/system-generated identifier for the insight. |
| INSIGHT_TYPE_ID | VARCHAR | Identifier of the insight type. |
| MESSAGE | VARIANT | Structured information and details about the insight. |
| SUGGESTIONS | ARRAY | Array of strings, each containing a recommended action for the insight. |
| IS_OPPORTUNITY | BOOLEAN | If true, the insight includes suggestions to improve query performance. |
| INSIGHT_TOPIC | VARCHAR | Label that identifies the type of performance impact detected by this insight. For the list of labels, see Insight topics. |
Usage notes¶
- Latency for the view may be up to 24 hours.
- The data is retained for 365 days (1 year).
Examples¶
For example queries, see the QUERY_INSIGHTS view in the ACCOUNT_USAGE schema. To find organization-level information, replace SNOWFLAKE.ACCOUNT_USAGE with SNOWFLAKE.ORGANIZATION_USAGE in the queries.