Monitoring and Troubleshooting Queries in Snowflake

Instruction: Explain how to monitor and troubleshoot query performance in Snowflake.

Context: The goal is to assess the candidate's ability to use Snowflake's tools and features for query monitoring, performance tuning, and troubleshooting to ensure optimal system performance.

Updated

Official answer

Capture query IDs and use Query History to locate slow or failing executions. Group comparable query shapes and examine workload frequency as well as individual duration: a moderately slow query repeated thousands of times may matter more than one rare long query.

Separate compilation, queue/provisioning time, execution and client/result-transfer effects. Warehouse load helps identify concurrency pressure; an execution optimization cannot remove time spent waiting for capacity.

Use Query Profile or supported operator statistics for actual executed work: scanned versus total partitions, bytes, join cardinalities, spill and expensive operators. EXPLAIN describes a prospective plan; it does not replace runtime evidence or prove that every full scan is inappropriate.

Choose a targeted change. Correct a join that multiplies rows, reduce unused columns, improve selective predicates or investigate a spill. Standard analytical tables do not accept conventional CREATE INDEX tuning; use supported optimization services only when their eligibility and cost fit the pattern.

Retest with comparable data, parameters, warehouse load and cache conditions. Verify output equivalence, latency distribution and cost per workload. Keep the prior version available, then monitor the affected query family for regressions. Automatic Clustering is a specific maintenance feature, not a guarantee that every table is always optimally arranged.

Query History and Profile, execution-time analysis, warehouse load

Related Questions