To categorize and examine similar queries in the query history, utilize a hash of the query text.
query_hash
The query_hash ensures that repeated queries with variations only in white space or comments share the same hash.
For example:
SELECT * FROM t1 WHERE name = 'jim'
SELECT * FROM t1 WHERE name = 'jim'
Both have the same query_hash.
query_parameterized_hash
The query_parameterized_hash is used when literals are part of a comparison predicate using operators such as =, !=, >=, or <=. Despite different literals, these queries share the same hash:
SELECT * FROM t1 WHERE name = 'data'
SELECT * FROM t1 WHERE name = 'bend'
Summary
To categorize and examine similar queries in the query history, utilize a hash of the query text.
query_hash
The
query_hash
ensures that repeated queries with variations only in white space or comments share the same hash. For example:Both have the same
query_hash
.query_parameterized_hash
The
query_parameterized_hash
is used when literals are part of a comparison predicate using operators such as=
,!=
,>=
, or<=
. Despite different literals, these queries share the same hash:Ref: https://docs.snowflake.com/en/user-guide/query-hash