Session Ready
Exercise

EXPLAIN the WHERE

Running a query with EXPLAIN does not actually run the query. Thus, EXPLAIN provides estimates of the query plan. The cost, rows, and width are all estimates. Some query structures result in better estimates than other structures.

You will take another look at Hawaiian air quality, focusing on the days where multiple locations fell into that AQI category (good, moderate, etc.). You will then look at the impact of a partition on the query plans estimates. Does the partition change the planner's estimates?

Instructions 1/3
undefined XP
  • 1

    Using a table of daily AQI, count the days in Hawaii with more than one site reporting that air quality category.

    • 2

      Examine the query plan row estimate using the same two WHERE clause filters. Is it the same as the prior 694?

    • 3

      Run the same query on daily_aqi_partitioned, a partitioned table. Is the row estimate the actual 694 row count?