QuestionQ34

Performance, Cost, and Resource Optimization

An Architect is diagnosing a poorly performing query by using the QUERY_HISTORY function. The Architect notices that COMPILATION_TIME exceeds EXECUTION_TIME.

What is the reason for this?

Explanation

Overly complex query logic can require the optimizer to evaluate many plan alternatives, making SQL compilation take longer than the warehouse execution phase. Snowflake identifies complex SQL—such as queries with many joins, Cartesian products, large IN lists, or very large statements—as having high compilation times.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!