Identifying query plans and bottlenecks
Through this recipe, you will understand Snowflake's query plans and learn how to identify bottlenecks and inefficiencies by reading through the query plans.
Getting ready
You will need to be connected to your Snowflake instance via the web UI or the SnowSQL client to execute this recipe.
How to do it…
We will be running a sample query using the TPCH sample dataset that is provided with Snowflake. The intent is to run an inefficient query, review its query plan, and identify which steps are using the most compute and contributing most to the overall query execution. The steps are as follows:
- We will start by executing a sample query on the TPCH dataset. Now, I am running this query on the X-Small virtual warehouse, so it may take around 15–20 minutes for this query to complete. It will likely complete faster if you are using a larger virtual warehouse. Note that the sample data is present in the
SNOWFLAKE_SAMPLE_DATA...