                                                                                 QUERY PLAN                                                                                 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=128546.87..128547.12 rows=100 width=91) (actual time=232.812..232.834 rows=100 loops=1)
   Buffers: shared hit=34513
   ->  Sort  (cost=128546.87..128551.94 rows=2028 width=91) (actual time=232.809..232.820 rows=100 loops=1)
         Sort Key: dt.d_year, (sum(store_sales.ss_net_profit)) DESC, item.i_brand_id
         Sort Method: quicksort  Memory: 53kB
         Buffers: shared hit=34513
         ->  GroupAggregate  (cost=128418.66..128469.36 rows=2028 width=91) (actual time=229.522..232.445 rows=200 loops=1)
               Group Key: dt.d_year, item.i_brand, item.i_brand_id
               Buffers: shared hit=34507
               ->  Sort  (cost=128418.66..128423.73 rows=2028 width=65) (actual time=229.493..229.821 rows=4001 loops=1)
                     Sort Key: dt.d_year, item.i_brand, item.i_brand_id
                     Sort Method: quicksort  Memory: 659kB
                     Buffers: shared hit=34507
                     ->  Hash Join  (cost=2402.39..128307.27 rows=2028 width=65) (actual time=22.220..221.748 rows=4001 loops=1)
                           Hash Cond: (store_sales.ss_sold_date_sk = dt.d_date_sk)
                           Buffers: shared hit=34504
                           ->  Nested Loop  (cost=7.09..125846.00 rows=25130 width=65) (actual time=0.216..192.093 rows=25848 loops=1)
                                 Buffers: shared hit=33099
                                 ->  Seq Scan on item  (cost=0.00..8239.00 rows=89 width=59) (actual time=0.106..59.735 rows=94 loops=1)
                                       Filter: (i_manufact_id = 445)
                                       Rows Removed by Filter: 101906
                                       Buffers: shared hit=6964
                                 ->  Bitmap Heap Scan on store_sales  (cost=7.09..1318.01 rows=342 width=14) (actual time=0.127..1.271 rows=275 loops=94)
                                       Recheck Cond: (ss_item_sk = item.i_item_sk)
                                       Heap Blocks: exact=25842
                                       Buffers: shared hit=26135
                                       ->  Bitmap Index Scan on store_sales_ss_item_sk_idx  (cost=0.00..7.00 rows=342 width=0) (actual time=0.066..0.066 rows=275 loops=94)
                                             Index Cond: (ss_item_sk = item.i_item_sk)
                                             Buffers: shared hit=293
                           ->  Hash  (cost=2318.11..2318.11 rows=6175 width=8) (actual time=21.934..21.934 rows=6200 loops=1)
                                 Buckets: 8192  Batches: 1  Memory Usage: 307kB
                                 Buffers: shared hit=1405
                                 ->  Seq Scan on date_dim dt  (cost=0.00..2318.11 rows=6175 width=8) (actual time=0.126..20.104 rows=6200 loops=1)
                                       Filter: (d_moy = 12)
                                       Rows Removed by Filter: 66849
                                       Buffers: shared hit=1405
 Planning:
   Buffers: shared hit=388
 Planning Time: 2.096 ms
 Execution Time: 233.034 ms
(40 rows)

