                                                                              QUERY PLAN                                                                               
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=940403.39..940406.26 rows=100 width=152)
   ->  GroupAggregate  (cost=940403.39..940495.12 rows=3191 width=152)
         Group Key: item.i_item_id, store.s_state
         Group Key: item.i_item_id
         Group Key: ()
         ->  Sort  (cost=940403.39..940407.37 rows=1595 width=39)
               Sort Key: item.i_item_id, store.s_state
               ->  Nested Loop  (cost=58108.82..940318.54 rows=1595 width=39)
                     ->  Nested Loop  (cost=58108.53..939304.49 rows=1595 width=26)
                           ->  Hash Join  (cost=58108.39..938991.70 rows=1870 width=27)
                                 Hash Cond: (store_sales.ss_cdemo_sk = customer_demographics.cd_demo_sk)
                                 ->  Hash Join  (cost=2322.65..882847.36 rows=136613 width=31)
                                       Hash Cond: (store_sales.ss_sold_date_sk = date_dim.d_date_sk)
                                       ->  Seq Scan on store_sales  (cost=0.00..804917.92 rows=28800992 width=35)
                                       ->  Hash  (cost=2318.11..2318.11 rows=363 width=4)
                                             ->  Seq Scan on date_dim  (cost=0.00..2318.11 rows=363 width=4)
                                                   Filter: (d_year = 2000)
                                 ->  Hash  (cost=55442.00..55442.00 rows=27499 width=4)
                                       ->  Seq Scan on customer_demographics  (cost=0.00..55442.00 rows=27499 width=4)
                                             Filter: ((cd_gender = 'M'::bpchar) AND (cd_marital_status = 'U'::bpchar) AND (cd_education_status = 'Secondary'::bpchar))
                           ->  Index Scan using store_pkey on store  (cost=0.14..0.17 rows=1 width=7)
                                 Index Cond: (s_store_sk = store_sales.ss_store_sk)
                                 Filter: (s_state = ANY ('{TN,TN,TN,TN,TN,TN}'::bpchar[]))
                     ->  Index Scan using item_pkey on item  (cost=0.29..0.64 rows=1 width=21)
                           Index Cond: (i_item_sk = store_sales.ss_item_sk)
(25 rows)

