ADA-C01 Question 276
Select 2Use query history filters including client-generated queries and queries executed by user tasksA Snowflake administrator is investigating a spike in warehouse usage between 01:00 and 03:00 UTC. The team suspects the activity came from two sources: SQL submitted automatically by BI tools and SQL executed by scheduled tasks owned by application service users. The administrator wants to isolate only those queries in Query History without reviewing unrelated interactive worksheet activity. Which TWO actions should the administrator take?
- A
Filter Query History to include client-generated statements so queries submitted by drivers, connectors, and BI tools are returned.
- B
Filter Query History to include queries executed by user tasks so statements run by tasks are returned.
- C
Filter Query History by SESSION_ID only, because task-executed queries and BI tool queries always share the same session pattern.
- D
Exclude all statements where USER_NAME is a service account, because task queries are not associated with users.
- E
Filter only by WAREHOUSE_NAME and ignore query source filters, because Query History does not distinguish client-generated queries from manually submitted queries.
Show answer and explanation
Correct answers: A, B
Explanation
The best answer is to use the specific Query History filters designed for the suspected sources of automated activity: client-generated queries and queries executed by user tasks. This allows an administrator to separate automated workload from interactive user activity and quickly identify the origin of warehouse usage spikes. Filtering only by warehouse, time range, or session can be helpful as supplemental criteria, but those do not replace source-specific filters. Snowflake best practice is to use the most targeted account usage and history filters available when troubleshooting cost, performance, or operational issues. This aligns with Snowflake Query History capabilities that distinguish automated client submissions from task-driven execution.
- A. Correct.
Correct. Query History supports filtering for client-generated statements, which helps isolate SQL submitted programmatically through clients such as drivers, connectors, and BI/ETL tools rather than manual execution in the Snowflake UI. In a real investigation, this is useful for separating automated external activity from interactive worksheet usage.
- B. Correct.
Correct. Query History can also be filtered to include queries executed by user tasks. This is the appropriate way to identify SQL run as part of scheduled task execution, which is especially important when investigating overnight warehouse consumption caused by automation.
- C. Incorrect.
Incorrect. SESSION_ID is not a reliable or intended mechanism for identifying all task-executed or client-generated queries. Different tools and tasks can use different sessions, and there is no universal session pattern that uniquely identifies these categories. Relying only on SESSION_ID can miss relevant activity or include unrelated queries.
- D. Incorrect.
Incorrect. Queries executed by tasks are associated with task execution context and can still be tracked in query history; excluding service accounts would likely hide the very activity under investigation. This distractor reflects the misconception that automation-generated queries are anonymous or not attributable.
- E. Incorrect.
Incorrect. Filtering by warehouse can narrow the time window and compute resource, but it does not isolate the source of the query. Query History does provide source-oriented filtering, including client-generated queries and task-executed queries, so ignoring those filters would make the investigation less precise.