
In the example below, I’m doing an analysis on average compile and execution time. As a general rule, identifying query groups and finding the max and min query runtime should help you sort through specific workflows. Now for a particularly useful tip: utilizing HASH on the QUERY_TEXT column can help you consolidate and group on similar queries (the HASH function will return the same result if any queries are exactly the same). These are particularly useful if you have identified specific workflow issues you need to address. We can also leverage the QUERY_HISTORY companion functions to narrow down your focus: This query provides a view into all of the queries run by the current user in the past hour: Let’s look at some syntax, per our documentation for QUERY_HISTORY: select *įrom table(information_schema.query_history(dateadd('hours',-1, current_timestamp()),current_timestamp())) Going through this analysis should help with identifying a good starting point. Although every development team should strive to periodically refactor their code, many find it challenging to determine where to start. Many customers are interested in improving their query performance. Query profiling is perhaps one of the more popular topics I field questions about. Ready to get started? Here we go! Query History Profiling Typically, the SYSADMIN role has the necessary warehouse MONITOR privileges across your entire account however, other lower-level roles may also have the necessary privileges. Keep in mind that you’ll need warehouse MONITOR privileges to perform the tasks described in this post. I will also show you a handy page in the UI that provides a graphical view of each query. To do this, I will show you examples using the QUERY_HISTORY family of functions. In this final post, I will deep-dive into understanding query profiling.


#Not ilike any snowflake how to
In my second post, I showed you how to get a handle on your storage usage. In my first post, I discussed getting a handle on your utilization of compute resources by using various Information Schema views and functions to profile your virtual warehouse usage.
#Not ilike any snowflake series
This article about query profiling is the third in a three-part series to help you utilize the functionality and data in Snowflake’s Information Schema to better understand and effectively Snowflake.Īs a Customer Success Engineer, my daily job entails helping our customers get the most value from our service.
