Troubleshooting and optimizing a slow-running Snowflake query: which tools and concepts to investigate

Quick Overview

Asks how to troubleshoot and speed up a slow-running query in Snowflake and which tools and platform concepts to investigate. Tests reading query execution evidence, partition pruning, memory and warehouse sizing, caching and query design trade-offs.

Troubleshooting and optimizing a slow-running Snowflake query: which tools and concepts to investigate

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

How would you approach troubleshooting and optimizing a slow-running query in Snowflake, and what specific tools and Snowflake-specific concepts would you investigate? ```hint Evidence first Before touching the warehouse or the SQL, find out where the time went in one specific run of the query. ``` ```hint Sort the symptoms For each thing you find, ask whether it means the query reads too much data, runs short of memory, or waits for resources. ``` ### Clarifying Questions to Ask - Has the query always been slow, or did it get slower recently without code changes? - Is it slow on every run, or only on the first run after the warehouse resumes? - What warehouse size runs it, and does that warehouse also serve other workloads at the same time? - Is the goal lower latency, lower credit cost, or both? ### What a Strong Answer Covers - A diagnosis-first approach that finds the dominant cost before changing anything - The Query Profile signals to read and what each one points to - Micro-partition pruning and clustering, and how the query's filters interact with them - Spilling, queuing and warehouse sizing, with a clear rule for scaling up versus scaling out - The caching layers and how they affect both repeated runs and fair measurement ### Follow-up Questions - When is a clustering key worth its maintenance cost, and how would you check whether a table is well clustered? - A recurring query got much slower overnight with no code change. Where would you look first? - How would you tell whether a bigger warehouse will make a query proportionally faster? - How would you monitor recurring queries so regressions are caught before users report them?

Overview: Asks how to troubleshoot and speed up a slow-running query in Snowflake and which tools and platform concepts to investigate. Tests reading query execution evidence, partition pruning, memory and warehouse sizing, caching and query design trade-offs.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

How would you approach troubleshooting and optimizing a slow-running query in Snowflake, and what specific tools and Snowflake-specific concepts would you investigate?

Clarifying Questions to Ask Guidance

  • Has the query always been slow, or did it get slower recently without code changes?
  • Is it slow on every run, or only on the first run after the warehouse resumes?
  • What warehouse size runs it, and does that warehouse also serve other workloads at the same time?
  • Is the goal lower latency, lower credit cost, or both?

What a Strong Answer Covers Guidance

  • A diagnosis-first approach that finds the dominant cost before changing anything
  • The Query Profile signals to read and what each one points to
  • Micro-partition pruning and clustering, and how the query's filters interact with them
  • Spilling, queuing and warehouse sizing, with a clear rule for scaling up versus scaling out
  • The caching layers and how they affect both repeated runs and fair measurement

Follow-up Questions Guidance

  • When is a clustering key worth its maintenance cost, and how would you check whether a table is well clustered?
  • A recurring query got much slower overnight with no code change. Where would you look first?
  • How would you tell whether a bigger warehouse will make a query proportionally faster?
  • How would you monitor recurring queries so regressions are caught before users report them?