History Tab
Analysis of Query Duration: Compilation Time
Query engine performing operations like cost based optimization and micropartition pruning
Analysis of Query Duration: Execution Time
Steps to process the data, processing time on the CPU
Query Analysis: Profile Overview: Processing
The percentage of the total execution time spent on data processing by the CPU of the virtual warehouse
Query Analysis: Profile Overview: Local Disk I/O
-The percentage of time processing was blocked by local disk access
- In other words, when the virtual warehouse had to read or write data from the local SSD storage
Query Analysis: Profile Overview: Remote Disk I/O
When the virtual warehouse had to read or write data from the remote storage layer
Database Order of Execution
Rows->Groups->Result
Rows statements
FROM
JOIN
WHERE
Group statements
GROUP BY
HAVING
Result statements
SELECT
DISTINCT
ORDER BY
LIMIT
Bytes spilled to local storage
Volume of data spilled to virtual warehouse local disk
Bytes spilled to remote storage
Volume of data spilled to remote disk.
Caching Layers
Services Layer
Warehouse Layer
Storage Layer
Services Layer Cache Categories
Metadata Cache
Results Cache
Metadata Cache
What does the metadata cache store?
-maintains understanding of what tables create, what databases those are in, what are the micro partitions that make up those tables, clustering information and more
- enables queries to be executed without the need of a virtual warehouse
- For example, the row count of each table is stored in a cache allowing for executing something such as a select count without using the virtual warehouse
- Functions, context functions, describe commands, and show commands make use of metadata
Results Cache
To reuse a result, ‘Result Cache’ Rule
Warehouse Cache
Materialized View
Materialized Views can be created on top of ____________ _____________ to improve their query performance.
external tables
Materialized Views are limited in the following ways:
Clustering
a way describing the distribution of a column’s values
Automatic Clustering