[Wranglers] QUERY_INSIGHTS view now available in Snowflake.
Ali, Saqib
docbook.xml at gmail.com
Fri Jul 4 13:39:10 UTC 2025
QUERY_INSIGHTS view is now available in Snowflake:
select *
from snowflake.account_usage.QUERY_INSIGHTS;
This VIEW provides information about the conditions that affect the Query
Performance, where applicable. The conditions can be any one of the
following:
1) Filter is not applicable i.e. the WHERE clause doesn’t filter out any
rows, which means that the query might scan more data than intended.
2) Filter is not selective i.e. the WHERE clause doesn’t significantly
reduce the number of rows, which means that the query might scan more data
than intended.
3) Filter uses clustering key i.e. the Query benefitted with the Clustering
Key.
4) Join with no join condition. The join is missing the join condition. The
result is a cross join, which returns every possible combination of rows.
5) Remote spillage. This query scanned more data than the warehouse had
capacity to store. As a result, the warehouse spilled data to storage,
which slowed down the processing of the query.
INSIGHT_TYPE_ID, MESSAGE and SUGGESTIONS are the key fields in the
QUERY_INSIGHTS view.
The best thing is that this VIEW has the QUERY_PARAMTERIZED_HASH column, so
you can track the improvements as you optimize the queries.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://analyticsengineering.net/pipermail/wranglers/attachments/20250704/ebf2df3e/attachment.htm>
More information about the Wranglers
mailing list