page281
369
Query History
Snowsight offers a Query History screen accessible from the Monitoring link on the
left side of the browser. Select Query History where the summary information for the
previous 14 days is displayed; shorter time periods can be displayed along with a Custom
option where a user-defined time period can be selected.
Use the DURATION column to order results by execution runtime.
Query Profile
Query profiles are useful for providing a visual indication of query execution operations
and for identifying the following:
•
How the query is physically executed
•
Warehouse size used for execution
•
Query execution order
•
Ordered list of operation costs
•
Spills to disk and out-of-memory (OOM) errors
•
Cache reuse
•
Micro-partition pruning
I discussed each aspect in detail in Chapter 3, noting preference for the following:
•
Small build-side tables
•
Large probe-side tables
•
Right deep tree joins
Recognizing “good” patterns is important when tuning Snowflake code; the query
profile tree and profile overview provide invaluable tools for performance tuning
queries.
Figure 10-6 shows an example query profile reused from Chapter 3; note that the
color coding in the PDF version is mine.
ChapTer 10
OpTimizing perfOrmanCe