Schema:

ACCOUNT_USAGE

QUERY_ACCELERATION_HISTORY view¶

This Account Usage view can be used to query the history of queries accelerated by the query acceleration service. The information returned by the view includes the warehouse name and the credits consumed by the query acceleration service.

Columns¶

Column Name

Data Type

Description

START_TIME

TIMESTAMP_LTZ

Start of the specified time range.

END_TIME

TIMESTAMP_LTZ

End of the specified time range.

CREDITS_USED

NUMBER

Number of credits billed for the query acceleration service during the START_TIME and END_TIME window.

WAREHOUSE_ID

NUMBER

Internal/system-generated identifier for the warehouse.

WAREHOUSE_NAME

TEXT

Name of the warehouse.

Usage notes¶

  • Billing history is not necessarily updated immediately. Latency for the view may be up to 180 minutes (3 hours).

  • If you want to reconcile the data in this view with a corresponding view in the ORGANIZATION USAGE schema, you must first set the timezone of the session to UTC. Before querying the Account Usage view, execute:

    ALTER SESSION SET TIMEZONE = UTC;
    
    Copy

Examples¶

This query returns the total number of credits used by each warehouse in your account for the query acceleration service (month-to-date):

SELECT warehouse_name,
       SUM(credits_used) AS total_credits_used
  FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ACCELERATION_HISTORY
  WHERE start_time >= DATE_TRUNC(month, CURRENT_DATE)
  GROUP BY 1
  ORDER BY 2 DESC;
Copy