COF-C03 Question 270
Single answerQuery historyA Snowflake administrator is investigating a reporting slowdown that occurred earlier in the day. The administrator needs to identify which SQL statements were executed by a specific analyst user, determine how long each query ran, and see whether any queries were retried due to transient issues. Which Snowflake source should the administrator use to get this information most directly?
- A
The QUERY_HISTORY table function or Account Usage QUERY_HISTORY view
- B
The WAREHOUSE_LOAD_HISTORY view
- C
The LOGIN_HISTORY view
- D
The TABLE_STORAGE_METRICS view
Show answer and explanation
Correct answer: A
Explanation
For investigating what queries a user ran and how those queries performed, Snowflake query history is the primary source. Snowflake provides query history through Information Schema table functions such as QUERY_HISTORY, QUERY_HISTORY_BY_USER, and related variants, as well as the SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY view for account-level historical analysis. These sources include details such as query text, user name, execution timestamps, status, elapsed time, and retry-related fields that are useful when diagnosing transient failures or performance issues. By contrast, WAREHOUSE_LOAD_HISTORY is useful for warehouse-level load trends, LOGIN_HISTORY is for authentication auditing, and TABLE_STORAGE_METRICS is for storage analysis. In practice, administrators often start with QUERY_HISTORY filtered by user name and time window, then correlate with warehouse metrics only if they need deeper root-cause analysis.
- A. Correct.
Correct. QUERY_HISTORY is designed to return query execution details such as the SQL text, user, start and end times, execution status, and performance-related metadata. Snowflake also exposes retry-related columns in query history outputs, making this the most direct source for investigating which statements a user ran and how they behaved. This is the appropriate place to analyze query duration and retry behavior for troubleshooting.
- B. Incorrect.
Incorrect. WAREHOUSE_LOAD_HISTORY helps analyze warehouse utilization and load over time, such as queued or running load percentages. While it can help determine whether a warehouse was under pressure, it does not directly provide the individual SQL statement text and per-query retry details needed for this investigation.
- C. Incorrect.
Incorrect. LOGIN_HISTORY shows authentication and sign-in activity, such as when users logged in and from where. It does not provide details about specific SQL statements executed, their execution time, or query retry information. A candidate might choose this option because the scenario mentions a specific user, but the requirement is about executed queries, not login events.
- D. Incorrect.
Incorrect. TABLE_STORAGE_METRICS provides information about storage consumption for tables, including active and time travel bytes. It is unrelated to troubleshooting query execution behavior. This distractor targets the misconception that all operational history views can help with performance analysis.