                                                                                 QUERY PLAN                                                                                  
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=948740.37..948743.25 rows=100 width=152)
   ->  GroupAggregate  (cost=948740.37..948832.11 rows=3191 width=152)
         Group Key: item.i_item_id, store.s_state
         Group Key: item.i_item_id
         Group Key: ()
         ->  Sort  (cost=948740.37..948744.36 rows=1595 width=39)
               Sort Key: item.i_item_id, store.s_state
               ->  Nested Loop  (cost=55786.48..948655.53 rows=1595 width=39)
                     ->  Nested Loop  (cost=55786.18..947641.48 rows=1595 width=26)
                           ->  Nested Loop  (cost=55786.04..947328.69 rows=1870 width=27)
                                 ->  Hash Join  (cost=55785.74..936306.42 rows=394267 width=31)
                                       Hash Cond: (store_sales.ss_cdemo_sk = customer_demographics.cd_demo_sk)
                                       ->  Seq Scan on store_sales  (cost=0.00..804917.92 rows=28800992 width=35)
                                       ->  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))
                                 ->  Result Cache  (cost=0.30..0.65 rows=1 width=4)
                                       Cache Key: store_sales.ss_sold_date_sk
                                       ->  Index Scan using date_dim_pkey on date_dim  (cost=0.29..0.64 rows=1 width=4)
                                             Index Cond: (d_date_sk = store_sales.ss_sold_date_sk)
                                             Filter: (d_year = 2000)
                           ->  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)
(26 rows)

