                                                          QUERY PLAN                                                           
-------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=127299.81..127300.06 rows=100 width=91)
   ->  Sort  (cost=127299.81..127304.88 rows=2028 width=91)
         Sort Key: dt.d_year, (sum(store_sales.ss_net_profit)) DESC, item.i_brand_id
         ->  GroupAggregate  (cost=127171.60..127222.30 rows=2028 width=91)
               Group Key: dt.d_year, item.i_brand, item.i_brand_id
               ->  Sort  (cost=127171.60..127176.67 rows=2028 width=65)
                     Sort Key: dt.d_year, item.i_brand, item.i_brand_id
                     ->  Nested Loop  (cost=7.39..127060.21 rows=2028 width=65)
                           ->  Nested Loop  (cost=7.09..125846.00 rows=25130 width=65)
                                 ->  Seq Scan on item  (cost=0.00..8239.00 rows=89 width=59)
                                       Filter: (i_manufact_id = 445)
                                 ->  Bitmap Heap Scan on store_sales  (cost=7.09..1318.01 rows=342 width=14)
                                       Recheck Cond: (ss_item_sk = item.i_item_sk)
                                       ->  Bitmap Index Scan on store_sales_ss_item_sk_idx  (cost=0.00..7.00 rows=342 width=0)
                                             Index Cond: (ss_item_sk = item.i_item_sk)
                           ->  Result Cache  (cost=0.30..0.33 rows=1 width=8)
                                 Cache Key: store_sales.ss_sold_date_sk
                                 ->  Index Scan using date_dim_pkey on date_dim dt  (cost=0.29..0.32 rows=1 width=8)
                                       Index Cond: (d_date_sk = store_sales.ss_sold_date_sk)
                                       Filter: (d_moy = 12)
(20 rows)

