WAREHOUSE_LOAD_HISTORY

functionsupportedAccounts, users, sessions, warehouses

docs.snowflake.com ↗

Information SchemaTable functions

This table function can be used to query the activity history (defined as the “query load”) for a single warehouse within a specified date range. Note This function returns warehouse activity within the last 14 days. Note Specifying a date value that is within one minute of the current timestamp can produce inaccurate results.

Syntax

supportedpartialnot supportednot scored

WAREHOUSE_LOAD_HISTORY(
      [ DATE_RANGE_START => <constant_expr> ]
      [, DATE_RANGE_END => <constant_expr> ]
      [, WAREHOUSE_NAME => '<string>' ] )

Parameters

NameRequiredDescription
DATE_RANGE_START => constant_expr , DATE_RANGE_END => constant_exprrequiredThe date range, within the last 14 days, for which to retrieve warehouse load history data: If an end date is not specified, then CURRENT_DATE is used as the end of the range. If a start date is not specified, then the range starts 10 minutes prior to the start of DATE_RANGE_END (i.e. the default is to show the previous 10 minutes of load history). For example, if DATE_RANGE_END is CURRENT_DATE, then the default DATE_RANGE_START is 11:50 PM on the previous day. If the range falls outside the last 15 days, an error is returned. Note If the selected period is less than 8 hours, load is shown in 5-second intervals; otherwise, 5-minute intervals are used.
WAREHOUSE_NAME => 'string'requiredThe name of the warehouse to retrieve usage load history for. Note that the warehouse name must be enclosed in single quotes. Also, if the warehouse name contains any spaces, mixed-case characters, or special characters, the name must be double-quoted within the single quotes (e.g. '"My Warehouse"' vs 'mywarehouse'). Default: CURRENT_WAREHOUSE

Usage notes

Output

Note For the output columns of this function, the query load value is the ratio of the total execution time (in seconds) of all queries in a specific state in an interval by the total time (in seconds) for that interval. For example, if 276 seconds was the total time for 4 queries in a 5 minute (300 second) interval, then the query load value is 276 / 300 = 0.92. The function returns the following columns: Column Name | Data Type | Description START_TIME | TIMESTAMP_LTZ | The start of the specified time range (in the UTC time zone) in which the warehouse usage took place. END_TIME | TIMESTAMP_LTZ | The end of the specified time range (in the UTC time zone) in which the warehouse usage took place. WAREHOUSE_NAME | VARCHAR | Name of the warehouse. AVG_RUNNING | NUMBER(38,2) | Query load value for queries executed. AVG_QUEUED_LOAD | NUMBER(38,2) | Query load value for queries queued because the warehouse was overloaded. AVG_QUEUED_PROVISIONING | NUMBER(38,2) | Query load value for queries queued because the warehouse was being provisioned. AVG_BLOCKED | NUMBER(38,2) | Query load value for queries blocked by a transaction lock.

See also

Referenced by