What you will be able to do
- Filter Snowsight Query History by user, warehouse and status, and include client-generated and task-run queries
- Turn worksheet results into a chart and choose a chart type, buckets and aggregation
- Build a dashboard from tiles without losing queries by mistake
- Share worksheets, charts and dashboards, and name the role and permission limits recipients hit
- Keep a dashboard recoverable before its owner is dropped
1.Filtering Query History in Snowsight
Monitoring » Query History in Snowsight lists the queries run in your account over the last 14 days. What you see depends on your active role. You always see your own queries. ACCOUNTADMIN sees every query in the account. A role with MONITOR or OPERATE on a warehouse sees other users' queries on that warehouse. The list opens filtered to the user you are signed in as, so an empty page often means only that the User filter has not been widened.
| Filter | Use it to find |
|---|---|
| Status | Long-running, failed or queued queries |
| User | All users you may see, yourself (the default), or one named user |
| Warehouse | Queries run on a specific warehouse |
| Statement Type, Duration, SQL Text, Query ID, Session ID, Query Tag | A specific kind of statement, slow queries, or one session or tagged job |
| Client generated statements | Internal queries from a client, driver or the web interface; these are not billed |
| Queries executed by user tasks | SQL statements run, or stored procedures called, by user tasks |
Statements run by scheduled tasks are also hidden by default. Turning on Queries executed by user tasks puts them in the same list as interactive work, which lets you compare a task's statement with what users ran on that warehouse at the same time. Run-level task status and errors live in Troubleshooting task runs with TASK_HISTORY.
Two display rules catch people out. Filters and the Started and End Time columns always use your current time zone, and setting the TIMEZONE parameter does not change that. Queries older than seven days also lose their User details because of session retention, though the User filter can still find them. Turn on Auto Refresh to reload the table every ten seconds.
Checkpoint 1 of 5· Match them up
Match each Query History filter to the investigation it is for
Tap a term, then the definition that fits it.
Query History hides client-generated statements and task-run statements until you turn on their own filters. Status and Session ID narrow the list by outcome or by session.
“Queries executed by user tasks, to view SQL statements executed or stored procedures called by user tasks.”Source: docs.snowflake.com
Sources1
2.Turning worksheet results into charts
A Snowsight chart is a view of one worksheet query's results. Run the worksheet and select Chart above the results table. Snowsight then builds a chart from the result columns. You can change it to a bar chart, line chart, scatterplot, heat grid or scorecard. Each query shows one chart type at a time, so if you need a bar view and a scorecard of the same data, you need two queries or two dashboard tiles.
Charts can regroup data without any change to the SQL. Date columns can be bucketed by date, week, month or year, and numeric columns by integer values. Each bucket is reduced to one value with average, count, minimum, maximum, median, mode or sum. The chart updates on every run as long as its columns are still in the results. If you rename a column in the query, the chart flags the missing column and you have to point it at the new name. Chart generation and data transformations can use compute, so a chart is not free to redraw.
It shows that the orders column cannot be found. The analyst has to update the chart to use order_count.
Checkpoint 2 of 5· Check yourself
A worksheet query returns one row per day with a daily order count. A manager wants the chart to show monthly totals instead. What is the simplest way to do that?
Charts can regroup a date column by date, week, month or year without changing the SQL. Each bucket is reduced to one value by an aggregation function such as sum. The one-chart-type-per-query limit applies only when you want a different chart type, not a different time grain.
“Without modifying your query, you can easily select a different bucket of time (e.g. weekly or monthly data) in the inspector panel”Source: docs.snowflake.com
Sources2
3.Building dashboards to monitor activity
A dashboard is a set of tiles. Each tile is a chart or table driven by its own query. You can start an empty one from Projects » Dashboards » + Dashboard, or move an existing worksheet into a dashboard. A useful monitoring dashboard pairs tiles over activity data, such as the QUERY_HISTORY view in SNOWFLAKE.ACCOUNT_USAGE. The context selector sets the role and warehouse for the queries, and Run refreshes every tile at once.
Moving a worksheet into a dashboard is not a copy. The worksheet disappears from the worksheet list and is reachable only from the dashboard. Anyone it was shared with loses access, its permissions are revoked, and its links stop working. Warn collaborators before you move a shared worksheet.
Removing a tile has two forms, and only one can be undone. Unplace Tile takes the tile off the dashboard but keeps its query available in the Add tile menu. Delete permanently removes the tile and its underlying query, with no undo. If a table tile and a chart tile share that query, both disappear. Dashboards also cannot be put into folders, so they cannot borrow a folder's sharing settings the way worksheets can.
Checkpoint 3 of 5· Check yourself
Your monitoring dashboard has a table tile and a chart tile, and both run on the same query. You want the chart off the dashboard for now, but you may want it back next quarter. What should you do?
Unplace Tile takes the tile off the dashboard and keeps its query in the Add tile menu. Delete permanently removes the query and cannot be undone. Because the two tiles share that query, deleting the chart would remove the table tile too.
“The tile is removed from the dashboard, but remains available to add to the dashboard from the Add tile menu.”Source: docs.snowflake.com
4.Sharing worksheets, charts and dashboards
A worksheet is shared through its Share button. You can invite named users or generate a link. The invite list shows only users who have signed in to Snowsight before, so a link is the only way to reach a new colleague. Collaborators see the most recently run version and no other. Your unsaved edits stay private until you run the worksheet, and a worksheet that has never been run looks empty to everyone else.
| Permission | Recipient can |
|---|---|
| Edit | Edit and run the worksheet (including with a different role), manage past versions, share it, move it to another folder |
| View + Run | Run it with the worksheet role, view latest results, duplicate and run it with their own role |
| View Results | View latest results if they have the worksheet role, duplicate and run with their own role |
| Link with View + Run | Run it with the worksheet role and view its contents, but not duplicate it |
| Link with View Results | View latest results with the worksheet role and view contents, but not duplicate or run it |
A chart has no share button of its own. It lives on a worksheet query or a dashboard tile, so it reaches other people through that worksheet or dashboard and inherits their limits:
- Recipients see results only if they hold the role the query ran under.
- They see up to 10,000 rows of the most recent version's results.
- Worksheets cannot be shared or replicated to another Snowflake account. To show the work elsewhere you copy the contents out of Snowflake.
Dashboard sharing is stricter on roles. Editors and owners share by name or by link, and a link grants nothing until you set what link holders may do. To view a shared dashboard, a user must use the same role as the session context of its queries. Dashboards also run only with the user's primary role and ignore DEFAULT_SECONDARY_ROLES. A recipient whose access comes only through a secondary role will see nothing.
Checkpoint 4 of 5· Check yourself
An analyst's primary role is ANALYST. MONITOR_ROLE is also granted to them, and their DEFAULT_SECONDARY_ROLES is set to ('ALL'). A colleague shares a dashboard whose queries run under MONITOR_ROLE. When the analyst opens it, no results appear. What fixes this?
Dashboards ignore secondary roles and run only with the user's primary role. A viewer must also use the same role as the dashboard queries' session context, so the analyst needs MONITOR_ROLE as their primary role. Dashboards cannot be put in folders, and a link grants nothing until its permissions are set.
“Dashboards run exclusively with the user’s primary role, regardless of the value set for DEFAULT_SECONDARY_ROLES.”Source: docs.snowflake.com
5.Keeping dashboards recoverable when the owner is dropped
A dashboard belongs to the user who created it, not to a role. When that user is dropped, their folders, worksheets and dashboards become inaccessible and do not pass to anyone else unless sharing was enabled. Recipients keep the permissions they were given. Only users with Edit can still change or delete the shared items, and if nobody else had Edit, the dropped owner's items can never be deleted.
The protection has to be set up before the user is dropped. An administrator can recover up to 500 unshared worksheets from a dropped user. Dashboards get no such rescue: a dashboard that was never shared with anyone is simply inaccessible. Before you drop an analyst who built team dashboards, have them share each dashboard and worksheet with Edit permission to a colleague who will take over. Separately, a deleted tile's query is gone permanently, so unplace tiles rather than delete them when you might want them back.
Checkpoint 5 of 5· Check yourself
Before a departing contractor's account is dropped, they must hand their monitoring dashboard to a colleague. The colleague will keep it running and share it with new team members. How should the contractor share it?
Only editors and owners can share a dashboard, and once the owner is dropped only Edit holders can still change or delete it. View + Run or a View Results link leaves the colleague unable to manage or pass the dashboard on. Administrator recovery covers unshared worksheets, not dashboards, so an unshared dashboard simply becomes inaccessible.
“Editors and owners can share a dashboard with individual collaborators or by enabling and using link sharing.”Source: docs.snowflake.com
Sources5
Sources
(5)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“The Query History page lets you explore queries executed in your Snowflake account over the last 14 days.”
↩︎ Filtering Query History in Snowsight“Queries executed by user tasks, to view SQL statements executed or stored procedures called by user tasks.”
↩︎ Filtering Query History in Snowsight“Filters and the Started and End Time columns use your current time zone.”
↩︎ Filtering Query History in Snowsight“If your active role has the MONITOR or OPERATE privilege granted on a warehouse”
↩︎ Filtering Query History in Snowsight“The QUERY_HISTORY view and AGGREGATE_QUERY_HISTORY view in the ACCOUNT_USAGE schema of the SNOWFLAKE database.”
↩︎ Building dashboards to monitor activity“Your account is not billed for client-generated statements.”
↩︎ Exam trap 1“Client generated statements, to view internal queries run by a client, driver, or library, including the web interface.”
↩︎ Prediction - 2.
“Each query supports one type of chart at a time.”
↩︎ Turning worksheet results into charts“Charts can bucket by date, week, month, and year for date columns.”
↩︎ Turning worksheet results into charts“Chart generation and data transformations in worksheets can result in compute usage.”
↩︎ Turning worksheet results into charts“Without modifying your query, you can easily select a different bucket of time (e.g. weekly or monthly data) in the inspector panel”
↩︎ Checkpoint - 3.
“Dashboards are flexible collections of charts arranged as tiles.”
↩︎ Building dashboards to monitor activity“When you use a worksheet to create a dashboard, the worksheet is removed from the list of worksheets”
↩︎ Building dashboards to monitor activity“Deleting a tile from a dashboard also deletes the underlying queries. This action cannot be undone.”
↩︎ Building dashboards to monitor activity“To view shared dashboards, the Snowflake user must use the same role as the session context for the queries that drive the dashboard.”
↩︎ Sharing worksheets, charts and dashboards“By default, people with the link cannot view the dashboard.”
↩︎ Sharing worksheets, charts and dashboards“Dashboards run exclusively with the user’s primary role, regardless of the value set for DEFAULT_SECONDARY_ROLES.”
↩︎ Exam trap 2“The tile is removed from the dashboard, but remains available to add to the dashboard from the Add tile menu.”
↩︎ Checkpoint“Dashboards run exclusively with the user’s primary role, regardless of the value set for DEFAULT_SECONDARY_ROLES.”
↩︎ Checkpoint“Editors and owners can share a dashboard with individual collaborators or by enabling and using link sharing.”
↩︎ Checkpoint - 4.
“The worksheet that is shared is the most recently run version.”
↩︎ Sharing worksheets, charts and dashboards“Worksheets cannot be replicated or shared across accounts.”
↩︎ Sharing worksheets, charts and dashboards“can view up to 10,000 rows of the results for the most recent version of the worksheet”
↩︎ Sharing worksheets, charts and dashboards - 5.
“the folders, worksheets, and dashboards owned by that user become inaccessible and do not transfer to another user unless sharing is enabled.”
↩︎ Keeping dashboards recoverable when the owner is dropped“only users with Edit permissions can modify or delete the shared folders, worksheets, and dashboards.”
↩︎ Keeping dashboards recoverable when the owner is dropped“an administrator can recover up to 500 worksheets owned by the user.”
↩︎ Keeping dashboards recoverable when the owner is dropped“dashboards will be inaccessible if they were not previously shared with another user.”
↩︎ Exam trap 3