<div dir="ltr">Both Snowflake and Redshift assign unique identifiers to SQL queries that can be used to track and monitor the performance of queries over time. Redshift calls it generic_query_hash whereas Snowflake calls it query_parameterized_hash, but the idea is the same. The hashes are generated based on the query's textual representation, excluding any literal values. The hash is usually created by normalizing the query structure and removing specific parameter values.<br><br>For e.g., the following two queries will produce the same query_parameterized_hash and generic_query_hash<br><br>select * from customers where full_name = 'Saqib';<br>select * from customers where full_name = 'Ali';<br><br><br><div>This allows for effective trend analysis and comparison of query performance across different periods. Here are two articles on how to use query_parameterized_hash or generic_query_hash to identify queries that are getting worse over time:</div><div><a href="https://qosf.com/whats-eating-up-your-snowflake-warehouse-part-2.html">https://qosf.com/whats-eating-up-your-snowflake-warehouse-part-2.html</a></div><div><a href="https://qosf.com/query_hash-and-query_parameterized_hash-in-snowflake.html">https://qosf.com/query_hash-and-query_parameterized_hash-in-snowflake.html</a></div></div>