LoslegenKostenlos loslegen

Creating and using an index

You are working with the US air quality index (AQI) data. AQI data captures four pollutants: ozone, particle pollution, carbon monoxide, and sulfur dioxide. You want to know if one of these pollutants is the main source of poor air quality.

The daily_aqi table contains daily AQI measurements. The defining_parameter field describes which of the four pollutants was the worst for that day.

You will be writing a lot of queries using the pollutant type as a filter. Before you dig into the data, you want to check if defining_parameter has an index on it. If not, you want to add one.

Diese Übung ist Teil des Kurses

Improving Query Performance in PostgreSQL

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

SELECT indexname
FROM ___
___ tablename = ___; -- Filter condition
Code bearbeiten und ausführen