EXPLAINing query behavior
Many times, queries have a different execution plan than you might expect. Earlier in the course, you ran a query to get all the December readings for air_temp
in Coffee County for the regular report type FM-15
. You used a CTE to limit it to the dates and then a select statement to filter the report types so it would be easy to shift timelines via the CTE. Let's look at an explanation of that statement.
Cet exercice fait partie du cours
Introduction to Redshift
Instructions
- Run
EXPLAIN
on the entire statement. - Update the
temp_reading
condition to be between Nov 1st and 30th of 2023.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
-- Explain the entire statement
___ WITH temp_readings as (
SELECT date,
hourlydrybulbtemperature AS air_temp,
report_type
FROM public_intro_redshift.coffee_county_weather
-- Set it to the proper dates in November 2023
WHERE date BETWEEN ___ AND ___
)
SELECT date,
air_temp
FROM temp_readings
WHERE report_type = 'FM-15';