ComenzarEmpieza gratis

Compare runtimes

Hawaii is home to many volcanoes. One volcano, Kīlauea has been erupting nearly continuously since 1983. The spewing volcanic smog (vog) is high in sulfur dioxide (SO2) and results in poor air quality. In fact, based on the count of good or moderate air quality days over 10 years (2008 to 2018), Hawaii has the worst air quality of any state.

In this exercise, you will look at the main air pollutant on poor air quality days, focusing on SO2 . You will compare the cost estimate between a query with an index on the pollutant column and a query without an index.

Este ejercicio forma parte del curso

Improving Query Performance in PostgreSQL

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

SELECT category
  , COUNT(*) as record_cnt
  , SUM(no_sites) as aqi_monitoring_site_cnt
FROM daily_aqi
___ ___ <> 'Good'
___ state_code = 15 -- Filter to Hawaii
GROUP BY category;
Editar y ejecutar código