Get startedGet started for free

Monitoring Query and Copy History

1. Monitoring a Query and Copy History

Welcome back! Let's go over how to monitor the query and copy history in Snowsight.

2. Benefits of Monitoring

Monitoring helps to answer questions about how tables are being queried, which queries take the longest to execute, and how much data is copied over to tables. This can help guide you to debug failures, optimize queries, and find past queries.

3. Viewing Query History

You can view the Query History under the Monitoring tab. Sometimes you will forget to save a SQL worksheet or have trouble finding a past query you wrote. Going to view the Query History can help you get it back. One thing to note is that the Query History goes back up to 14 days.

4. Finding a Query

To find a query, go to Monitoring and Query History. Under Individual Queries I can see queries executed by my username. There are drop down filters I can choose like query status, date range, and other filters including SQL Text. Let's filter for queries that used the SALES_TRANSACTIONS table. Applying that filter, I can now select one to view the query details.

5. Query Details

Query Details includes information on when the query was executed, the query id, and the session id. This information can be helpful when creating an issue ticket to the Snowflake support team using Snowsight. Providing exact query information can help them debug an issue faster. There's also the SQL text and the results for you to see. You can open the query in a new SQL worksheet and save it.

6. Viewing Copy History

As a Data Engineer it is important to monitor the data loaded into Snowflake, where the sources are from, and how often loads succeed and fail. A high privilege role can view this in two ways. First option is to view the Copy History under the Monitoring tab. This shows all copy activities in the account, but there can be data delay of up to 45 minutes according to Snowflake. However, from personal experience longer delays are possible. The second option is to view the Copy History of a specific table by going to the table itself. You will see the latest copy attempts for that table. This information is considered sensitive so users with only PUBLIC role access are restricted from viewing this content.

7. Copy History Demo

Under Monitoring and Copy History we can see all copy activities of the account. You can adjust the date range to expand the history and see the files that were loaded including the size, the number of rows, and the target table. Under Table and Copy History we can see the same information for that specific table. It also shows the latest copy attempt failed. You can hover over it to see the error to help you debug the issue.

8. Let's practice!

Let's review what we just discussed!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.