Troubleshooting Query Performance Issues in Snowflake
Instruction: Describe your approach to identifying and resolving query performance issues in Snowflake.
Updated
Official answer
First establish scope: one query, one warehouse, one client, or many workloads. Capture timestamps, query IDs, errors and the last known healthy execution. Check service status and recent deployment/configuration changes rather than assuming repeated symptoms rule out a platform incident.
Compare a slow execution with a similar healthy one: SQL/parameters, data volume, role/session settings, warehouse size/load and cache state. Separate queue time from execution and result-transfer time.
For example, if total time rises from 5 to 65 seconds while execution remains 5 seconds, investigate the extra 60 seconds of waiting before rewriting SQL. If execution itself grows, inspect runtime profiles for scan growth, join expansion, spill or changed predicates.
Form a testable hypothesis and change one relevant factor. A newly duplicated dimension key can multiply join rows; increasing warehouse size may hide the symptom while leaving incorrect results. Validate key cardinalities and output totals before treating this as a capacity issue.
Reproduce on a bounded representative workload, preserve the baseline, and measure the candidate fix under comparable conditions. Check tail latency, failure rate, output equivalence and cost, then roll out with a way to restore the prior behavior.
Document the observed cause and evidence. If the diagnosis remains uncertain, state that uncertainty and collect the missing trace instead of presenting generic clustering or scaling advice as a confirmed fix.