                                                                                          QUERY PLAN                                                                                           
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=1081241.69..1081241.94 rows=100 width=163) (actual time=6719.731..6719.764 rows=100 loops=1)
   Buffers: shared hit=755520
   ->  Sort  (cost=1081241.69..1081571.73 rows=132016 width=163) (actual time=6719.728..6719.750 rows=100 loops=1)
         Sort Key: ('store'::text), ('ss_customer_sk'::text), date_dim.d_year, date_dim.d_qoy, item.i_category
         Sort Method: top-N heapsort  Memory: 48kB
         Buffers: shared hit=755520
         ->  HashAggregate  (cost=1074545.93..1076196.13 rows=132016 width=163) (actual time=6716.538..6718.435 rows=653 loops=1)
               Group Key: ('store'::text), ('ss_customer_sk'::text), date_dim.d_year, date_dim.d_qoy, item.i_category
               Batches: 1  Memory Usage: 6681kB
               Buffers: shared hit=755511
               ->  Append  (cost=26911.91..1051443.20 rows=1320156 width=129) (actual time=700.727..5677.999 rows=684810 loops=1)
                     Buffers: shared hit=755511
                     ->  Hash Join  (cost=26911.91..563546.44 rows=1244449 width=129) (actual time=700.725..3032.349 rows=648196 loops=1)
                           Hash Cond: (store_sales.ss_item_sk = item.i_item_sk)
                           Buffers: shared hit=485391
                           ->  Hash Join  (cost=17652.91..551020.63 rows=1244449 width=18) (actual time=598.293..2481.924 rows=648196 loops=1)
                                 Hash Cond: (store_sales.ss_sold_date_sk = date_dim.d_date_sk)
                                 Buffers: shared hit=478427
                                 ->  Bitmap Heap Scan on store_sales  (cost=14604.31..544549.56 rows=1303725 width=14) (actual time=547.930..1824.297 rows=1296253 loops=1)
                                       Recheck Cond: (ss_customer_sk IS NULL)
                                       Heap Blocks: exact=475928
                                       Buffers: shared hit=477022
                                       ->  Bitmap Index Scan on store_sales_ss_customer_sk_idx  (cost=0.00..14278.38 rows=1303725 width=0) (actual time=266.601..266.601 rows=1296253 loops=1)
                                             Index Cond: (ss_customer_sk IS NULL)
                                             Buffers: shared hit=1094
                                 ->  Hash  (cost=2135.49..2135.49 rows=73049 width=12) (actual time=49.977..49.978 rows=73049 loops=1)
                                       Buckets: 131072  Batches: 1  Memory Usage: 4163kB
                                       Buffers: shared hit=1405
                                       ->  Seq Scan on date_dim  (cost=0.00..2135.49 rows=73049 width=12) (actual time=0.013..27.231 rows=73049 loops=1)
                                             Buffers: shared hit=1405
                           ->  Hash  (cost=7984.00..7984.00 rows=102000 width=55) (actual time=102.015..102.016 rows=102000 loops=1)
                                 Buckets: 131072  Batches: 1  Memory Usage: 9778kB
                                 Buffers: shared hit=6964
                                 ->  Seq Scan on item  (cost=0.00..7984.00 rows=102000 width=55) (actual time=0.026..64.075 rows=102000 loops=1)
                                       Buffers: shared hit=6964
                     ->  Hash Join  (cost=12307.60..272050.86 rows=3118 width=129) (actual time=147.360..2087.814 rows=869 loops=1)
                           Hash Cond: (web_sales.ws_item_sk = item_1.i_item_sk)
                           Buffers: shared hit=196117
                           ->  Hash Join  (cost=3048.60..262783.68 rows=3118 width=18) (actual time=50.676..1990.075 rows=869 loops=1)
                                 Hash Cond: (web_sales.ws_sold_date_sk = date_dim_1.d_date_sk)
                                 Buffers: shared hit=189153
                                 ->  Seq Scan on web_sales  (cost=0.00..259726.89 rows=3119 width=14) (actual time=0.941..1939.085 rows=1774 loops=1)
                                       Filter: (ws_ship_hdemo_sk IS NULL)
                                       Rows Removed by Filter: 7195792
                                       Buffers: shared hit=187748
                                 ->  Hash  (cost=2135.49..2135.49 rows=73049 width=12) (actual time=49.066..49.067 rows=73049 loops=1)
                                       Buckets: 131072  Batches: 1  Memory Usage: 4163kB
                                       Buffers: shared hit=1405
                                       ->  Seq Scan on date_dim date_dim_1  (cost=0.00..2135.49 rows=73049 width=12) (actual time=0.007..25.994 rows=73049 loops=1)
                                             Buffers: shared hit=1405
                           ->  Hash  (cost=7984.00..7984.00 rows=102000 width=55) (actual time=96.346..96.347 rows=102000 loops=1)
                                 Buckets: 131072  Batches: 1  Memory Usage: 9778kB
                                 Buffers: shared hit=6964
                                 ->  Seq Scan on item item_1  (cost=0.00..7984.00 rows=102000 width=55) (actual time=0.009..59.459 rows=102000 loops=1)
                                       Buffers: shared hit=6964
                     ->  Hash Join  (cost=13141.52..196043.56 rows=72589 width=129) (actual time=187.146..454.305 rows=35745 loops=1)
                           Hash Cond: (catalog_sales.cs_item_sk = item_2.i_item_sk)
                           Buffers: shared hit=74003
                           ->  Hash Join  (cost=3882.52..186594.00 rows=72589 width=18) (actual time=90.955..331.098 rows=35745 loops=1)
                                 Hash Cond: (catalog_sales.cs_sold_date_sk = date_dim_2.d_date_sk)
                                 Buffers: shared hit=67039
                                 ->  Bitmap Heap Scan on catalog_sales  (cost=833.92..183353.85 rows=72966 width=14) (actual time=46.595..247.732 rows=71734 loops=1)
                                       Recheck Cond: (cs_bill_customer_sk IS NULL)
                                       Heap Blocks: exact=65571
                                       Buffers: shared hit=65634
                                       ->  Bitmap Index Scan on catalog_sales_cs_bill_customer_sk_idx  (cost=0.00..815.68 rows=72966 width=0) (actual time=21.630..21.630 rows=71734 loops=1)
                                             Index Cond: (cs_bill_customer_sk IS NULL)
                                             Buffers: shared hit=63
                                 ->  Hash  (cost=2135.49..2135.49 rows=73049 width=12) (actual time=44.269..44.269 rows=73049 loops=1)
                                       Buckets: 131072  Batches: 1  Memory Usage: 4163kB
                                       Buffers: shared hit=1405
                                       ->  Seq Scan on date_dim date_dim_2  (cost=0.00..2135.49 rows=73049 width=12) (actual time=0.014..22.763 rows=73049 loops=1)
                                             Buffers: shared hit=1405
                           ->  Hash  (cost=7984.00..7984.00 rows=102000 width=55) (actual time=96.055..96.055 rows=102000 loops=1)
                                 Buckets: 131072  Batches: 1  Memory Usage: 9778kB
                                 Buffers: shared hit=6964
                                 ->  Seq Scan on item item_2  (cost=0.00..7984.00 rows=102000 width=55) (actual time=0.009..59.421 rows=102000 loops=1)
                                       Buffers: shared hit=6964
 Planning:
   Buffers: shared hit=719
 Planning Time: 4.133 ms
 Execution Time: 6725.675 ms
(82 rows)

