Schema:

ORGANIZATION_USAGE

For guidance on query performance when using organization-wide usage views, see Performance (Organization Usage).

QUERY_ACCELERATION_ELIGIBLE 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 can be used to identify queries that are eligible for the query acceleration service (QAS).

Columns

Organization-level columns

Column NameData TypeDescription
ORGANIZATION_NAMEVARCHARName of the organization.
ACCOUNT_LOCATORVARCHARSystem-generated identifier for the account.
ACCOUNT_NAMEVARCHARUser-defined identifier for the account.

Additional columns

Column NameData TypeDescription
QUERY_IDVARCHARInternal/system-generated identifier for the SQL statement.
QUERY_TEXTVARCHARText of the SQL statement.
START_TIMETIMESTAMP_LTZStatement start time.
END_TIMETIMESTAMP_LTZStatement end time.
WAREHOUSE_NAMEVARCHARName of the warehouse that the query executed on.
WAREHOUSE_SIZEVARCHARSize of the warehouse when this statement executed.
ELIGIBLE_QUERY_ACCELERATION_TIMENUMBERAmount of query execution time (in seconds) eligible for the query acceleration service.
UPPER_LIMIT_SCALE_FACTORNUMBERUpper limit scale factor for the given query.
QUERY_HASHVARCHARThe hash value computed based on the canonicalized SQL text.
QUERY_HASH_VERSIONNUMBERThe version of the logic used to compute QUERY_HASH.
QUERY_PARAMETERIZED_HASHVARCHARThe hash value computed based on the parameterized query.
QUERY_PARAMETERIZED_HASH_VERSIONNUMBERThe version of the logic used to compute QUERY_PARAMETERIZED_HASH.

Usage notes

  • Latency for the view may be up to 24 hours.
  • Query acceleration is supported for the following SQL commands:

    • SELECT
    • INSERT
    • CREATE TABLE AS SELECT (CTAS)
    • COPY INTO <table>

    For more information about query eligibility, see Eligible queries.

  • This view only includes eligible queries that have not been accelerated. If you have enabled the query acceleration service and previously QAS-eligible queries are now accelerated, they are not included in this view.

Examples

Identify the warehouses with the most queries eligible in a given period of time for the query acceleration service:

SELECT account_name, warehouse_name, COUNT(query_id) AS num_eligible_queries
  FROM SNOWFLAKE.ORGANIZATION_USAGE.QUERY_ACCELERATION_ELIGIBLE
  WHERE start_time >= '2024-06-01 00:00'::TIMESTAMP
  AND end_time <= '2024-06-07 00:00'::TIMESTAMP
  GROUP BY warehouse_name
  ORDER BY num_eligible_queries DESC;

For more example queries, see Identifying queries and warehouses with the QUERY_ACCELERATION_ELIGIBLE view.