Challenge - 5 Problems
Query History and Profiling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
Understanding Query History Table Output
You run the following query in Snowflake to check recent query history:
What will the total_elapsed_time column represent in the output?
SELECT query_id, user_name, execution_status, total_elapsed_time FROM table(information_schema.query_history()) WHERE user_name = 'ANALYST' ORDER BY start_time DESC LIMIT 3;What will the total_elapsed_time column represent in the output?
Snowflake
SELECT query_id, user_name, execution_status, total_elapsed_time FROM table(information_schema.query_history()) WHERE user_name = 'ANALYST' ORDER BY start_time DESC LIMIT 3;
Attempts:
2 left
💡 Hint
Think about what 'elapsed time' usually means in timing contexts.
✗ Incorrect
The total_elapsed_time column shows the full duration the query took to run, measured in milliseconds, from start to finish including all processing time.
🧠 Conceptual
intermediate2:00remaining
Identifying Query Failures from History
You want to find all queries that failed in the last 24 hours using Snowflake's query history. Which execution_status value should you filter for to get only failed queries?
Attempts:
2 left
💡 Hint
Think about the status that indicates a query did not complete successfully.
✗ Incorrect
The execution_status 'FAILED' indicates queries that ended with an error and did not complete successfully.
❓ Architecture
advanced2:00remaining
Optimizing Query Profiling for Large Workloads
Your Snowflake account runs thousands of queries daily. You want to efficiently analyze query performance trends over the past week without scanning the entire query history table. Which approach is best to reduce query time and cost?
Attempts:
2 left
💡 Hint
Filtering early reduces data scanned and speeds up queries.
✗ Incorrect
Filtering on start_time in the QUERY_HISTORY view limits data scanned, reducing cost and improving query speed. Selecting only needed columns also helps.
❓ security
advanced2:00remaining
Controlling Access to Query History Data
Which Snowflake role should you assign to a user to allow them to view query history but prevent them from modifying any data or running queries themselves?
Attempts:
2 left
💡 Hint
This role is designed for read-only monitoring tasks.
✗ Incorrect
The MONITOR role grants read-only access to account usage and query history without permissions to modify data or run queries.
✅ Best Practice
expert3:00remaining
Interpreting Query Profile for Performance Bottlenecks
You examine the query profile for a slow-running Snowflake query. The profile shows a large amount of time spent in the 'Spilled to Disk' operation. What does this indicate and what is the best next step?
Attempts:
2 left
💡 Hint
Spilling to disk usually means memory limits were exceeded.
✗ Incorrect
Spilled to Disk means Snowflake had to write intermediate data to disk because memory was insufficient, causing slower query execution. Increasing warehouse size or rewriting the query can help.