page85
67
FROM v_supplier_part
ORDER BY part_name ASC,
unit_price DESC
LIMIT 10;
Figure 3-13 shows sample explain plan output noting further information is available
scrolling off the right of the screen (not shown).
Figure 3-13.
Explain plan output
Interestingly, Snowflake also provides a query ID and link next to the explain plan
output; however, no query profile is available. The absence of a query profile is due to
the query not having been executed.
Snowflake also provides functions to convert
EXPLAIN
JSON to text. You can find
further details at
https://docs.snowflake.com/en/sql-reference/functions/
system_explain_plan_json
.
EXPLAIN
is very useful when developing new queries. Having the capability for
Snowflake to generate a query profile before execution can save time and prevent
expensive mistakes. I suggest all unit tests include
EXPLAIN
output, and you could go
further by profiling every SQL statement as part of the continuous integration testing and
scan the output for keywords.
You can find further details for
EXPLAIN
at
https://docs.snowflake.com/en/sql-
reference/sql/explain
.
ChapTer 3
The Query profiler