{"id":49529,"date":"2023-11-15T13:14:47","date_gmt":"2023-11-15T12:14:47","guid":{"rendered":"https:\/\/www.inovex.de\/?p=49529"},"modified":"2023-11-15T13:14:47","modified_gmt":"2023-11-15T12:14:47","slug":"increasing-query-performance-using-the-snowflake-query-history","status":"publish","type":"post","link":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/","title":{"rendered":"Increasing Query Performance Using the Snowflake Query History"},"content":{"rendered":"<p>Picture this: You are responsible for running a big data platform in Snowflake and over the last few months you noticed a steady increase in the consumed credits. There are no new use cases that you know of. You have already talked to the data onboarding team about the amount of data that is ingested every day and they confirmed to you, that the amount of ingested data has been more or less constant over the last half year. So the old use cases are not dealing with an increase in data volume per day. How do you find out what is causing the increase in consumed credits?<!--more--><\/p>\n<p>Other than monetary cost, there are many different reasons why you should be concerned about the performance of your <a href=\"https:\/\/www.inovex.de\/de\/blog\/datenpipeline-mit-streams-und-tasks-in-snowflake\/\">data pipelines<\/a>. Faster query execution means users can retrieve the information they need more quickly. This is crucial in applications where real-time or near-real-time responses are required. Faster access to data also means quicker decision-making, which can be crucial in situations where timely information is of utmost importance (e.g., in emergency response systems). Finally, well-optimized query performance enables the system to handle more concurrent users or larger datasets without a significant drop in response times.<\/p>\n<p>In this article, we take a look at Snowflake&#8217;s QUERY_HISTORY view. How can it be used to identify costly queries and what clues does it provide for fixing problematic queries?<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\"><\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Investigating-Query-Performance-in-the-QUERY-HISTORY-View\" >Investigating Query Performance in the QUERY_HISTORY View<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Monthly-Query-Run-Time\" >Monthly Query Run Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Query-Run-Time-by-Query-Type\" >Query Run Time by Query Type<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Using-the-Query-Hash\" >Using the Query Hash<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Query-Performance-Indicators\" >Query Performance Indicators<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Data-Spilling\" >Data Spilling<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Micro-partition-Usage\" >Micro-partition Usage<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Nailing-Down-the-Root-Cause\" >Nailing Down the Root Cause<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Storing-and-Updating-Costly-Query-Results\" >Storing and Updating Costly Query Results<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#Conclusions\" >Conclusions<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Investigating-Query-Performance-in-the-QUERY-HISTORY-View\"><\/span>Investigating Query Performance in the QUERY_HISTORY View<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The ACCOUNT_USAGE and READER_ACCOUNT_USAGE schema both contain a view called QUERY_HISTROY. There are some differences between the two views (detailed <a href=\"https:\/\/docs.snowflake.com\/de\/sql-reference\/account-usage\/query_history\" target=\"_blank\" rel=\"noopener\">here<\/a>), but for our purposes either will work.<\/p>\n<p>The QUERY_HISTROY contains metadata for all queries that have been run within the Snowflake account over the last 365 days. As with all ACCOUNT_USAGE views, there is some latency with which the information is available. In this case, it is about 45 minutes.<\/p>\n<p>A note about credit usage: Since Snowflake does not bill you for computation time directly, estimating the credits consumed by a specific query is an inexact science. Snowflake bills you for warehouse uptime. So you might be tempted to multiply the time elapsed during the query compilation and execution for a specific query (in seconds) with the credits per second for the warehouse it ran on. There are however two problems with this approach. Warehouses can run several queries in parallel, so you might be overestimating the costs for each specific query. On the other hand, running a query might wake the warehouse up from suspension and leave it in the active state for an unnecessarily long time, leading to underestimations of the cost caused by a specific query. For these reasons, we will simply use the query run time (TOTAL_ELAPSED_TIME in the QUERY_HISTORY view) as an indicator of how costly it is.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Monthly-Query-Run-Time\"><\/span>Monthly Query Run Time<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There are several different dimensions along which we can investigate queries in order to find problematic queries as a target for performance improvements. First, we\u2019ll take a look at a monthly breakdown of the query run time:<\/p>\n<pre class=\"lang:default decode:true \" title=\"query runtime by month\">SELECT\r\n    DATE_TRUNC('MONTH', \"START_TIME\") as MONTH,\r\n    COUNT(*) as QUERY_COUNT,\r\n    MIN(TOTAL_ELAPSED_TIME\/1000) as MIN_ELAPSED_TIME_S,\r\n    MAX(TOTAL_ELAPSED_TIME\/1000) as MAX_ELAPSED_TIME_S,\r\n    SUM(TOTAL_ELAPSED_TIME\/1000) as SUM_ELAPSED_TIME_S\r\nFROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY\r\nGROUP BY MONTH<\/pre>\n\n<table id=\"tablepress-82\" class=\"tablepress tablepress-id-82\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">MONTH<\/th><th class=\"column-2\">QUERY_COUNT<\/th><th class=\"column-3\">MIN_ELAPSED_TIME_S<\/th><th class=\"column-4\">MAX_ELAPSED_TIME_S<\/th><th class=\"column-5\">SUM_ELAPSED_TIME_S<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">2023-09-01<\/td><td class=\"column-2\">973<\/td><td class=\"column-3\">0.021<\/td><td class=\"column-4\">18,939.449<\/td><td class=\"column-5\">1,167,132.897<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2023-08-01<\/td><td class=\"column-2\">877<\/td><td class=\"column-3\">0.016<\/td><td class=\"column-4\">20,769.261<\/td><td class=\"column-5\">1,023,945.685<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">2023-07-01<\/td><td class=\"column-2\">541<\/td><td class=\"column-3\">0.017<\/td><td class=\"column-4\">13,981.067<\/td><td class=\"column-5\">983,629.880<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">2023-06-01<\/td><td class=\"column-2\">661<\/td><td class=\"column-3\">0.018<\/td><td class=\"column-4\">18,257.220<\/td><td class=\"column-5\">269,772.616<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">2023-05-01<\/td><td class=\"column-2\">695<\/td><td class=\"column-3\">0.025<\/td><td class=\"column-4\">12,104.698<\/td><td class=\"column-5\">297,825.463<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">2023-04-01<\/td><td class=\"column-2\">618<\/td><td class=\"column-3\">0.019<\/td><td class=\"column-4\">8,248.591<\/td><td class=\"column-5\">190,993.656<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">2023-03-01<\/td><td class=\"column-2\">798<\/td><td class=\"column-3\">0.021<\/td><td class=\"column-4\">9,178.900<\/td><td class=\"column-5\">394,948.741<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">2023-02-01<\/td><td class=\"column-2\">695<\/td><td class=\"column-3\">0.020<\/td><td class=\"column-4\">6,417.905<\/td><td class=\"column-5\">265,338.306<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">2023-01-01<\/td><td class=\"column-2\">618<\/td><td class=\"column-3\">0.021<\/td><td class=\"column-4\">6,716.117<\/td><td class=\"column-5\">195,266.476<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">2022-12-01<\/td><td class=\"column-2\">798<\/td><td class=\"column-3\">0.019<\/td><td class=\"column-4\">5,772.717<\/td><td class=\"column-5\">106,1075.433<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">2022-11-01<\/td><td class=\"column-2\">878<\/td><td class=\"column-3\">0.018<\/td><td class=\"column-4\">8,700.304<\/td><td class=\"column-5\">160,056.014<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">2022-10-01<\/td><td class=\"column-2\">486<\/td><td class=\"column-3\">0.021<\/td><td class=\"column-4\">5,487.664<\/td><td class=\"column-5\">104,637.947<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-82 from cache -->\n<p>The TOTAL_ELAPSED_TIME combines the compilation time and the execution time. Query compilation encompasses for example parsing, fetching metadata, and query rewriting. We can see that the run time for queries has indeed increased over the last 4 months. Based on this information, we can investigate the last month in more detail.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Query-Run-Time-by-Query-Type\"><\/span>Query Run Time by Query Type<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We can break down all queries from the last month by query type.<\/p>\n<pre class=\"lang:default decode:true \" title=\"query runtime by query type\">SELECT\r\n    QUERY_TYPE,\r\n    COUNT(*) as QUERY_COUNT,\r\n    MIN(TOTAL_ELAPSED_TIME\/1000) as MIN_ELAPSED_TIME_S,\r\n    MAX(TOTAL_ELAPSED_TIME\/1000) as MAX_ELAPSED_TIME_S,\r\n    SUM(TOTAL_ELAPSED_TIME\/1000) as SUM_ELAPSED_TIME_S\r\nFROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY\r\nWHERE DATE_TRUNC('MONTH', \"START_TIME\") = '2023-09-01'\r\nGROUP BY QUERY_TYPE\r\nORDER BY SUM_ELAPSED_TIME_S\r\nLIMIT 5<\/pre>\n\n<table id=\"tablepress-83\" class=\"tablepress tablepress-id-83\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">QUERY_TYPE<\/th><th class=\"column-2\">QUERY_COUNT<\/th><th class=\"column-3\">MIN_ELAPSED_TIME_S<\/th><th class=\"column-4\">MAX_ELAPSED_TIME_S<\/th><th class=\"column-5\">SUM_ELAPSED_TIME_S<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">SELECT<\/td><td class=\"column-2\">302<\/td><td class=\"column-3\">0.023<\/td><td class=\"column-4\">18,939.449<\/td><td class=\"column-5\">339,173.783<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">CREATE_TABLE_AS_SELECT<\/td><td class=\"column-2\">231<\/td><td class=\"column-3\">0.331<\/td><td class=\"column-4\">17,698.261<\/td><td class=\"column-5\">253,989.821<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">DELETE<\/td><td class=\"column-2\">80<\/td><td class=\"column-3\">0.481<\/td><td class=\"column-4\">1,257.196<\/td><td class=\"column-5\">2,955.905<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">UPDATE<\/td><td class=\"column-2\">23<\/td><td class=\"column-3\">0.345<\/td><td class=\"column-4\">651.831<\/td><td class=\"column-5\">1,580.721<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">SHOW<\/td><td class=\"column-2\">32<\/td><td class=\"column-3\">0.021<\/td><td class=\"column-4\">7.328<\/td><td class=\"column-5\">28.765<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-83 from cache -->\n<p>The query type gives us a good indication of what kind of queries typically run for how long. Here, SELECT and CREATE_TABLE_AS_SELECT take by far the longest. This is typical since SELECT queries often need to scan large tables or perform complex aggregations.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Using-the-Query-Hash\"><\/span>Using the Query Hash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In order to really track down what kind of queries are the most costly, we can use one of Snowflake&#8217;s newer features. With the 2023_06 behavior change bundle the QUERY_HISTORY view gained <a href=\"https:\/\/docs.snowflake.com\/user-guide\/query-hash#label-query-hash-prerequisites\">some new columns<\/a> that help us to find non-obvious patterns in queries. Snowflake calculates a query hash for each query. Even queries that are not syntactically identical receive the same hash. In particular, the column QUERY_PARAMETERIZED_HASH is interesting for us, because this hash ignores differences in whitespace as well as literal arguments within the query. This allows us to group queries by their general structure and get a better picture of the kind of queries that cause the most problems.<\/p>\n<p>Also pay attention to the QUERY_PARAMETERIZED_HASH_VERSION column, since hashes produced by different versions of the hashing logic should not be used for grouping queries. To keep queries simple, we assume here that all hashes are produced by the same logic.<\/p>\n<p>Let&#8217;s look at some queries that give us some insight into several performance indicators.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Query-Performance-Indicators\"><\/span>Query Performance Indicators<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We first look at run times for different kinds of queries.<\/p>\n<pre class=\"lang:default decode:true \" title=\"query run time by query hash\">SELECT\r\n    QUERY_PARAMETERIZED_HASH,\r\n    COUNT(*) as QUERY_COUNT,\r\n    MIN(TOTAL_ELAPSED_TIME\/1000) as MIN_ELAPSED_TIME_S,\r\n    MAX(TOTAL_ELAPSED_TIME\/1000) as MAX_ELAPSED_TIME_S,\r\nFROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY\r\nWHERE DATE_TRUNC('MONTH', \"START_TIME\") = '2023-09-01'\r\nGROUP BY QUERY_PARAMETERIZED_HASH\r\nORDER BY MAX_ELAPSED_TIME_S\r\nLIMIT 5<\/pre>\n\n<table id=\"tablepress-84\" class=\"tablepress tablepress-id-84\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">QUERY_PARAMETERIZED_HASH<\/th><th class=\"column-2\">QUERY_COUNT<\/th><th class=\"column-3\">MIN_ELAPSED_TIME_S<\/th><th class=\"column-4\">MAX_ELAPSED_TIME_S<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">00d8f496857f970b8187cb89008b9ffb<\/td><td class=\"column-2\">30<\/td><td class=\"column-3\">15,230.136<\/td><td class=\"column-4\">18,939.449<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">01630b795a0b07452936076314b999ee<\/td><td class=\"column-2\">24<\/td><td class=\"column-3\">0.026<\/td><td class=\"column-4\">1508.126<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">01e81ce2a48c0ac6d12390fd25e482c6<\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">48.491<\/td><td class=\"column-4\">159.186<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">01ff4d44bd11bfb5add87d88e2ce8019<\/td><td class=\"column-2\">1<\/td><td class=\"column-3\">123.426<\/td><td class=\"column-4\">123.426<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">02f54b0f2bfc98844a87cfabf32ba360<\/td><td class=\"column-2\">3<\/td><td class=\"column-3\">39.347<\/td><td class=\"column-4\">39.347<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-84 from cache -->\n<p>We sorted the results by the maximum run time for each query hash, because it gives a good first indication of what queries likely cause the most costs. Instances, where the minimum run time is near instant, indicate that the query has been answered from <a href=\"https:\/\/community.snowflake.com\/s\/article\/Understanding-Result-Caching\" target=\"_blank\" rel=\"noopener\">cached results<\/a>. But also run times of less than 10 seconds warrant some investigations. If a query is answered very fast on a large warehouse, it is likely that the query can also be executed quickly in a smaller warehouse, which saves cost.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Data-Spilling\"><\/span>Data Spilling<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There are several reasons why a query sometimes takes a long time to be answered. The first obvious reason is that it requires complicated operations and aggregations to produce the result. If a query takes disproportionately long, it is time to look for potential optimizations. Let\u2019s look more closely at other performance indicators.<\/p>\n<pre class=\"lang:default decode:true \" title=\"query data spilling by query hash\">SELECT\r\n    QUERY_PARAMETERIZED_HASH,\r\n    COUNT(*) as QUERY_COUNT,\r\n    MAX(BYTES_SPILLED_TO_LOCAL_STORAGE) as SPILLED_L_STORAGE,\r\n    MAX(BYTES_SPILLED_TO_REMOTE_STORAGE) as SPILLED_R_STORAGE,\r\nFROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY\r\nWHERE DATE_TRUNC('MONTH', \"START_TIME\") = '2023-09-01'\r\nGROUP BY QUERY_PARAMETERIZED_HASH\r\nLIMIT 5<\/pre>\n\n<table id=\"tablepress-85\" class=\"tablepress tablepress-id-85\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">QUERY_PARAMETERIZED_HASH<\/th><th class=\"column-2\">QUERY_COUNT<\/th><th class=\"column-3\">SPILLED_L_STORAGE<\/th><th class=\"column-4\">SPILLED_R_STORAGE<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">00d8f496857f970b8187cb89008b9ffb<\/td><td class=\"column-2\">30<\/td><td class=\"column-3\">2,899,818,373<\/td><td class=\"column-4\">1,422,512,417<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">01630b795a0b07452936076314b999ee<\/td><td class=\"column-2\">24<\/td><td class=\"column-3\">224,158,589<\/td><td class=\"column-4\">456,256,215<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">01e81ce2a48c0ac6d12390fd25e482c6<\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">22,451,456<\/td><td class=\"column-4\">0<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">01ff4d44bd11bfb5add87d88e2ce8019<\/td><td class=\"column-2\">1<\/td><td class=\"column-3\">242,112,473<\/td><td class=\"column-4\">0<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">02f54b0f2bfc98844a87cfabf32ba360<\/td><td class=\"column-2\">3<\/td><td class=\"column-3\">48,245,168<\/td><td class=\"column-4\">0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-85 from cache -->\n<p>The queries with the longest run times in our results also show that quite a lot of data is spilled to local and remote disks. This occurs when the warehouse executing the query runs out of memory. In these cases, the data required for answering the query is temporarily stored on disk, which particularly in the case of remote disk spilling means slow read and write processes that prolong the execution time. For queries that spill a lot of data to remote storage, it can be useful to experiment with larger warehouses. Virtual Warehouses not only double the number of computing cores with each step between T-shirt sizes but also provide more RAM and local disk space. This avoids remote spilling and typically provides a big boost in execution time.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Micro-partition-Usage\"><\/span>Micro-partition Usage<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Another performance indicator from the query history view is the ratio between the PARTITIONS_SCANNED and the PARTITIONS_TOTAL.<\/p>\n<pre class=\"lang:default decode:true \" title=\"partitions scanned by query hash\">SELECT\r\n    QUERY_PARAMETERIZED_HASH,\r\n    COUNT(*) as QUERY_COUNT,\r\n    MAX(PARTITIONS_SCANNED) as PARTITIONS_SCANNED,\r\n    MAX(PARTITIONS_TOTAL) as PARTITIONS_TOTAL\r\nFROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY\r\nWHERE DATE_TRUNC('MONTH', \"START_TIME\") = '2023-09-01'\r\nGROUP BY QUERY_PARAMETERIZED_HASH\r\nLIMIT 5<\/pre>\n\n<table id=\"tablepress-86\" class=\"tablepress tablepress-id-86\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">QUERY_PARAMETERIZED_HASH<\/th><th class=\"column-2\">QUERY_COUNT<\/th><th class=\"column-3\">PARTITIONS_SCANNED<\/th><th class=\"column-4\">PARTITIONS_TOTAL<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">00d8f496857f970b8187cb89008b9ffb<\/td><td class=\"column-2\">30<\/td><td class=\"column-3\">140,927<\/td><td class=\"column-4\">251,727<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">01630b795a0b07452936076314b999ee<\/td><td class=\"column-2\">24<\/td><td class=\"column-3\">240,933<\/td><td class=\"column-4\">251,597<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">01e81ce2a48c0ac6d12390fd25e482c6<\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">3,482<\/td><td class=\"column-4\">249,471<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">01ff4d44bd11bfb5add87d88e2ce8019<\/td><td class=\"column-2\">1<\/td><td class=\"column-3\">22,951<\/td><td class=\"column-4\">247,104<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">02f54b0f2bfc98844a87cfabf32ba360<\/td><td class=\"column-2\">3<\/td><td class=\"column-3\">15,539<\/td><td class=\"column-4\">245,689<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-86 from cache -->\n<p>These two columns give you an idea about how many micro partitions were scanned versus how many micro partitions all tables included in the query are composed of. If a lot of micro partitions that ultimately did not contribute to the result were scanned, it is worth checking the clustering of the tables that are used in that query. Make sure to understand what micro partitions are and how Snowflake performs <a href=\"https:\/\/docs.snowflake.com\/en\/user-guide\/tables-clustering-micropartitions\" target=\"_blank\" rel=\"noopener\">automatic clustering<\/a>. For large tables (&gt; 1TB) or tables that are frequently queried with WHERE, JOIN or ORDER_BY clauses, it might be worthwhile to specify a clustering key, so that micro partitions can be pruned more effectively during query execution.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Nailing-Down-the-Root-Cause\"><\/span>Nailing Down the Root Cause<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There are lots of different reasons why queries take longer than you would expect and equally many ways to optimize them. In our example analysis we have seen, that the amount of data that is spilled to remote storage is quite considerable. So we might investigate further in that direction. From this point on you can start investigating individual queries. We have isolated similar queries using the QUERY_PARAMETERIZED_HASH. Using this hash we can get individual query IDs that we can look at more closely.<\/p>\n<pre title=\"example query from query hash\">SELECT\r\n    QUERY_ID,\r\n    QUERY_TEXT,\r\n    QUERY_PARAMETERIZED_HASH\r\nFROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY\r\nWHERE QUERY_PARAMETERIZED_HASH = '00d8f496857f970b8187cb89008b9ffb'\r\nLIMIT 1\r\n<\/pre>\n\n<table id=\"tablepress-87\" class=\"tablepress tablepress-id-87\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">QUERY_ID<\/th><th class=\"column-2\">QUERY_TEXT<\/th><th class=\"column-3\">QUERY_PARAMETERIZED_HASH<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">01af43ee-0302-d906-0000-1bb5239e7346<\/td><td class=\"column-2\">SELECT<br \/>\ncount(*) as count_transactions,  <br \/>\nmax(st.value) as max_value,<br \/>\nsum(st.value) as sum_value<br \/>\nfrom stg_transactions st<br \/>\nwhere st.transaction_timestamp &gt;= '2023-06-01'<br \/>\n<\/td><td class=\"column-3\">00d8f496857f970b8187cb89008b9ffb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-87 from cache -->\n<p>Snowflake offers great tooling for analyzing queries, like the <a href=\"https:\/\/docs.snowflake.com\/en\/user-guide\/ui-query-profile\" target=\"_blank\" rel=\"noopener\">Query Profiler<\/a>. It can give you insight into how the query is executed step by step.<\/p>\n<p>One common problem the query profiler can point out to you is misplaced WHERE clauses. Filter steps should happen as early as possible within a query execution. Filtering late can cause larger result sets during aggregations and joins, which in the worst case cause data spill to remote storage.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Storing-and-Updating-Costly-Query-Results\"><\/span>Storing and Updating Costly Query Results<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Looking at the queries with the most data spilling in our example, we can see that the filter on the time column is quite coarse and results in transaction data starting from 2023-06-01 being aggregated every day. While the amount of transaction data added every day has not increased, obviously the total amount of transactions increases every day. Here it would make sense to perform the aggregation less often (maybe once a week) and store the results in a new table. If the aggregation needs to incorporate the most current transactions every day, sums, counts, min, and max aggregations can easily be updated daily without reading all the transactions every time.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusions\"><\/span>Conclusions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Performance optimization of queries in a big data setting is oftentimes a long and tedious process. With the QUERY_HISTORY, Snowflake offers us a great resource for investigating the performance of our queries by giving us easy access to metadata like run times, partitions scanned, and data spilled.<\/p>\n<p>The new query hash feature makes it easy to group queries and identify the kind of queries that warrant closer investigation. With tools like Snowflake&#8217;s Query Profiler and a good understanding of how Snowflake executes queries, we can come up with more efficient queries for our daily workloads. This not only reduces cost but also increases the productivity of the team and the satisfaction of our data consumers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Picture this: You are responsible for running a big data platform in Snowflake and over the last few months you noticed a steady increase in the consumed credits. There are no new use cases that you know of. You have already talked to the data onboarding team about the amount of data that is ingested [&hellip;]<\/p>\n","protected":false},"author":315,"featured_media":47268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"ep_exclude_from_search":false,"footnotes":""},"tags":[77,385,828,1108],"service":[411],"coauthors":[{"id":315,"display_name":"Steven Kutsch","user_nicename":"skutsch"}],"class_list":["post-49529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-big-data","tag-data-engineering","tag-optimization","tag-snowflake","service-data-engineering"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Increasing Query Performance Using the Snowflake Query History - inovex GmbH<\/title>\n<meta name=\"description\" content=\"The Snowflake query history helps you find problematic queries and gives insight into what optimization gives the biggest performance boost.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Increasing Query Performance Using the Snowflake Query History - inovex GmbH\" \/>\n<meta property=\"og:description\" content=\"The Snowflake query history helps you find problematic queries and gives insight into what optimization gives the biggest performance boost.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/\" \/>\n<meta property=\"og:site_name\" content=\"inovex GmbH\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inovexde\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-15T12:14:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Steven Kutsch\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1-1024x576.png\" \/>\n<meta name=\"twitter:creator\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:site\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Steven Kutsch\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"10\u00a0Minuten\" \/>\n\t<meta name=\"twitter:label3\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data3\" content=\"Steven Kutsch\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/\"},\"author\":{\"name\":\"Steven Kutsch\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/person\\\/aacd34246f4d8d9dad80456ef39cf0f6\"},\"headline\":\"Increasing Query Performance Using the Snowflake Query History\",\"datePublished\":\"2023-11-15T12:14:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/\"},\"wordCount\":1651,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/header-snowflake-1.png\",\"keywords\":[\"Big Data\",\"Data Engineering\",\"Optimization\",\"Snowflake\"],\"articleSection\":[\"Analytics\",\"English Content\",\"General\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/\",\"name\":\"Increasing Query Performance Using the Snowflake Query History - inovex GmbH\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/header-snowflake-1.png\",\"datePublished\":\"2023-11-15T12:14:47+00:00\",\"description\":\"The Snowflake query history helps you find problematic queries and gives insight into what optimization gives the biggest performance boost.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/header-snowflake-1.png\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/header-snowflake-1.png\",\"width\":1920,\"height\":1080,\"caption\":\"Blaue Snowflake Logos auf wei\u00dfem Hintergrund mit Wolken.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/increasing-query-performance-using-the-snowflake-query-history\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Increasing Query Performance Using the Snowflake Query History\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\",\"name\":\"inovex GmbH\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\",\"name\":\"inovex GmbH\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/inovex-logo-16-9-1.png\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/inovex-logo-16-9-1.png\",\"width\":1921,\"height\":1081,\"caption\":\"inovex GmbH\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inovexde\",\"https:\\\/\\\/x.com\\\/inovexgmbh\",\"https:\\\/\\\/www.instagram.com\\\/inovexlife\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inovex\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UC7r66GT14hROB_RQsQBAQUQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/person\\\/aacd34246f4d8d9dad80456ef39cf0f6\",\"name\":\"Steven Kutsch\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/cropped-profile_sk-96x96.jpg710184d2efe38de1c2443a6c09ca9ef2\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/cropped-profile_sk-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/cropped-profile_sk-96x96.jpg\",\"caption\":\"Steven Kutsch\"},\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/author\\\/skutsch\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Increasing Query Performance Using the Snowflake Query History - inovex GmbH","description":"The Snowflake query history helps you find problematic queries and gives insight into what optimization gives the biggest performance boost.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/","og_locale":"de_DE","og_type":"article","og_title":"Increasing Query Performance Using the Snowflake Query History - inovex GmbH","og_description":"The Snowflake query history helps you find problematic queries and gives insight into what optimization gives the biggest performance boost.","og_url":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/","og_site_name":"inovex GmbH","article_publisher":"https:\/\/www.facebook.com\/inovexde","article_published_time":"2023-11-15T12:14:47+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1.png","type":"image\/png"}],"author":"Steven Kutsch","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1-1024x576.png","twitter_creator":"@inovexgmbh","twitter_site":"@inovexgmbh","twitter_misc":{"Verfasst von":"Steven Kutsch","Gesch\u00e4tzte Lesezeit":"10\u00a0Minuten","Written by":"Steven Kutsch"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#article","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/"},"author":{"name":"Steven Kutsch","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/aacd34246f4d8d9dad80456ef39cf0f6"},"headline":"Increasing Query Performance Using the Snowflake Query History","datePublished":"2023-11-15T12:14:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/"},"wordCount":1651,"commentCount":0,"publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1.png","keywords":["Big Data","Data Engineering","Optimization","Snowflake"],"articleSection":["Analytics","English Content","General"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/","url":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/","name":"Increasing Query Performance Using the Snowflake Query History - inovex GmbH","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#primaryimage"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1.png","datePublished":"2023-11-15T12:14:47+00:00","description":"The Snowflake query history helps you find problematic queries and gives insight into what optimization gives the biggest performance boost.","breadcrumb":{"@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#primaryimage","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/header-snowflake-1.png","width":1920,"height":1080,"caption":"Blaue Snowflake Logos auf wei\u00dfem Hintergrund mit Wolken."},{"@type":"BreadcrumbList","@id":"https:\/\/www.inovex.de\/de\/blog\/increasing-query-performance-using-the-snowflake-query-history\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inovex.de\/de\/"},{"@type":"ListItem","position":2,"name":"Increasing Query Performance Using the Snowflake Query History"}]},{"@type":"WebSite","@id":"https:\/\/www.inovex.de\/de\/#website","url":"https:\/\/www.inovex.de\/de\/","name":"inovex GmbH","description":"","publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inovex.de\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.inovex.de\/de\/#organization","name":"inovex GmbH","url":"https:\/\/www.inovex.de\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","width":1921,"height":1081,"caption":"inovex GmbH"},"image":{"@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inovexde","https:\/\/x.com\/inovexgmbh","https:\/\/www.instagram.com\/inovexlife\/","https:\/\/www.linkedin.com\/company\/inovex","https:\/\/www.youtube.com\/channel\/UC7r66GT14hROB_RQsQBAQUQ"]},{"@type":"Person","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/aacd34246f4d8d9dad80456ef39cf0f6","name":"Steven Kutsch","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/wp-content\/uploads\/cropped-profile_sk-96x96.jpg710184d2efe38de1c2443a6c09ca9ef2","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/cropped-profile_sk-96x96.jpg","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/cropped-profile_sk-96x96.jpg","caption":"Steven Kutsch"},"url":"https:\/\/www.inovex.de\/de\/blog\/author\/skutsch\/"}]}},"_links":{"self":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/49529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/users\/315"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/comments?post=49529"}],"version-history":[{"count":5,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/49529\/revisions"}],"predecessor-version":[{"id":49852,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/49529\/revisions\/49852"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media\/47268"}],"wp:attachment":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media?parent=49529"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/tags?post=49529"},{"taxonomy":"service","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/service?post=49529"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/coauthors?post=49529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}