                                                              QUERY PLAN                                                              
--------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=90629162.19..90629162.23 rows=17 width=11)
   InitPlan 1 (returns $0)
     ->  Unique  (cost=2501.50..2501.66 rows=31 width=4)
           ->  Sort  (cost=2501.50..2501.58 rows=31 width=4)
                 Sort Key: date_dim.d_month_seq
                 ->  Seq Scan on date_dim  (cost=0.00..2500.73 rows=31 width=4)
                       Filter: ((d_year = 1998) AND (d_moy = 3))
   ->  Sort  (cost=90626660.53..90626660.57 rows=17 width=11)
         Sort Key: (count(*)), a.ca_state
         ->  GroupAggregate  (cost=90626632.60..90626660.18 rows=17 width=11)
               Group Key: a.ca_state
               Filter: (count(*) >= 10)
               ->  Sort  (cost=90626632.60..90626641.58 rows=3593 width=3)
                     Sort Key: a.ca_state
                     ->  Nested Loop  (cost=1.44..90626420.41 rows=3593 width=3)
                           ->  Nested Loop  (cost=1.02..90623597.74 rows=3593 width=4)
                                 ->  Nested Loop  (cost=0.72..1534583.04 rows=10779 width=8)
                                       ->  Nested Loop  (cost=0.30..1526030.66 rows=11290 width=8)
                                             ->  Seq Scan on store_sales s  (cost=0.00..804917.92 rows=28800992 width=12)
                                             ->  Result Cache  (cost=0.30..0.61 rows=1 width=4)
                                                   Cache Key: s.ss_sold_date_sk
                                                   ->  Index Scan using date_dim_pkey on date_dim d  (cost=0.29..0.60 rows=1 width=4)
                                                         Index Cond: (d_date_sk = s.ss_sold_date_sk)
                                                         Filter: (d_month_seq = $0)
                                       ->  Index Scan using customer_pkey on customer c  (cost=0.42..0.76 rows=1 width=8)
                                             Index Cond: (c_customer_sk = s.ss_customer_sk)
                                 ->  Index Scan using item_pkey on item i  (cost=0.29..8265.05 rows=1 width=4)
                                       Index Cond: (i_item_sk = s.ss_item_sk)
                                       Filter: (i_current_price > (1.2 * (SubPlan 2)))
                                       SubPlan 2
                                         ->  Aggregate  (cost=8264.44..8264.45 rows=1 width=32)
                                               ->  Seq Scan on item j  (cost=0.00..8239.00 rows=10173 width=6)
                                                     Filter: (i_category = i.i_category)
                           ->  Index Scan using customer_address_pkey on customer_address a  (cost=0.42..0.79 rows=1 width=7)
                                 Index Cond: (ca_address_sk = c.c_current_addr_sk)
(35 rows)

