page310
398
FROM TABLE ( information_schema.query_history())
WHERE queued_overload_time > 0
AND execution_time > 0;
You can find information on queueing at
https://community.snowflake.com/s/
article/Understanding-Queuing
.
Warehouse Workload
Identifying workload peaks and troughs may provide the means to balance your
workloads throughout the day. For example, housekeeping processes and generating
summaries can often be moved to quiet times or parallelized to consume more
processing units from a running but under-utilized warehouse. Please refer to Chapter 6
for a fuller explanation.
SELECT warehouse_name,
start_time,
end_time,
query_id,
query_text,
total_elapsed_time / 1000 AS total_elapsed_time_in_secs,
transaction_blocked_time,
DATE_PART ( 'YYYY', start_time )||
LPAD ( DATE_PART ( 'MM', start_time ), 2, '0' )||
LPAD ( DATE_PART ( 'DD', start_time ), 2, '0' )||'_'||
LPAD ( DATE_PART ( 'HOUR', start_time ), 2, '0' )
AS date_time
FROM snowflake.account_usage.query_history
WHERE execution_time <> 0
ORDER BY warehouse_name,
start_time DESC;
The previous query provides a high-level view of activity only.
ChapTer 10
OpTimizing perfOrmanCe