page313
401
CASE execution_time
WHEN 0 THEN 1
ELSE execution_time
END AS execution_time_1,
compilation_time / execution_time_1
FROM TABLE ( information_schema.query_history())
WHERE ( compilation_time / execution_time_1 ) > 1
AND warehouse_size IS NOT NULL;
Guidance on resolving long compilation time is provided in Chapter 3. You can find
more information on long compilation time at
https://community.snowflake.com/s/
article/Understanding-Why-Compilation-Time-in-Snowflake-Can-Be-Higher-than-
Execution-Time
.
Long Execution Time
Long execution time occurs after a query has been compiled and relates to the physical
amount of time required to return a result set. Please refer to Chapter 3 for a full
explanation.
SELECT query_id,
warehouse_name,
warehouse_size,
total_elapsed_time / 1000 AS query_execution_time_s
FROM TABLE ( information_schema.query_history())
WHERE warehouse_name IS NOT NULL
AND execution_status = 'SUCCESS'
AND bytes_scanned > 0
AND total_elapsed_time > 1000;
Guidance on resolving long execution time is provided in Chapter 3. You can find
more information on long execution time at
https://docs.snowflake.com/en/user-
guide/performance-query-exploring
.
ChapTer 10
OpTimizing perfOrmanCe