                                                                                 QUERY PLAN                                                                                 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=127299.81..127300.06 rows=100 width=91) (actual time=244.705..244.727 rows=100 loops=1)
   Buffers: shared hit=38577
   ->  Sort  (cost=127299.81..127304.88 rows=2028 width=91) (actual time=244.702..244.712 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=38577
         ->  GroupAggregate  (cost=127171.60..127222.30 rows=2028 width=91) (actual time=241.433..244.336 rows=200 loops=1)
               Group Key: dt.d_year, item.i_brand, item.i_brand_id
               Buffers: shared hit=38571
               ->  Sort  (cost=127171.60..127176.67 rows=2028 width=65) (actual time=241.404..241.728 rows=4001 loops=1)
                     Sort Key: dt.d_year, item.i_brand, item.i_brand_id
                     Sort Method: quicksort  Memory: 659kB
                     Buffers: shared hit=38571
                     ->  Nested Loop  (cost=7.39..127060.21 rows=2028 width=65) (actual time=0.359..233.535 rows=4001 loops=1)
                           Buffers: shared hit=38568
                           ->  Nested Loop  (cost=7.09..125846.00 rows=25130 width=65) (actual time=0.216..205.326 rows=25848 loops=1)
                                 Buffers: shared hit=33099
                                 ->  Seq Scan on item  (cost=0.00..8239.00 rows=89 width=59) (actual time=0.101..63.398 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.129..1.370 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.067..0.067 rows=275 loops=94)
                                             Index Cond: (ss_item_sk = item.i_item_sk)
                                             Buffers: shared hit=293
                           ->  Result Cache  (cost=0.30..0.33 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=25848)
                                 Cache Key: store_sales.ss_sold_date_sk
                                 Hits: 24024  Misses: 1824  Evictions: 0  Overflows: 0  Memory Usage: 128kB
                                 Buffers: shared hit=5469
                                 ->  Index Scan using date_dim_pkey on date_dim dt  (cost=0.29..0.32 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1824)
                                       Index Cond: (d_date_sk = store_sales.ss_sold_date_sk)
                                       Filter: (d_moy = 12)
                                       Rows Removed by Filter: 1
                                       Buffers: shared hit=5469
 Planning:
   Buffers: shared hit=388
 Planning Time: 2.258 ms
 Execution Time: 245.128 ms
(41 rows)

