                                                                                              QUERY PLAN                                                                                              
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=359605.92..359606.17 rows=100 width=117) (actual time=13285.021..13285.045 rows=100 loops=1)
   Buffers: shared hit=2332019
   ->  Sort  (cost=359605.92..359607.54 rows=648 width=117) (actual time=13285.019..13285.031 rows=100 loops=1)
         Sort Key: (substr((warehouse.w_warehouse_name)::text, 1, 20)), ship_mode.sm_type, call_center.cc_name
         Sort Method: top-N heapsort  Memory: 48kB
         Buffers: shared hit=2332019
         ->  HashAggregate  (cost=359573.06..359581.16 rows=648 width=117) (actual time=13283.612..13283.939 rows=720 loops=1)
               Group Key: substr((warehouse.w_warehouse_name)::text, 1, 20), ship_mode.sm_type, call_center.cc_name
               Batches: 1  Memory Usage: 297kB
               Buffers: shared hit=2332013
               ->  Hash Join  (cost=5.65..355308.62 rows=71074 width=85) (actual time=9.154..9135.673 rows=2839008 loops=1)
                     Hash Cond: (catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk)
                     Buffers: shared hit=2332013
                     ->  Hash Join  (cost=4.42..354863.09 rows=71450 width=57) (actual time=9.125..6855.920 rows=2840797 loops=1)
                           Hash Cond: (catalog_sales.cs_call_center_sk = call_center.cc_call_center_sk)
                           Buffers: shared hit=2332012
                           ->  Hash Join  (cost=1.89..354638.91 rows=71816 width=47) (actual time=9.081..5610.468 rows=2844449 loops=1)
                                 Hash Cond: (catalog_sales.cs_ship_mode_sk = ship_mode.sm_ship_mode_sk)
                                 Buffers: shared hit=2332010
                                 ->  Nested Loop  (cost=0.43..354407.98 rows=72201 width=20) (actual time=9.048..4204.686 rows=2851680 loops=1)
                                       Buffers: shared hit=2332009
                                       ->  Seq Scan on date_dim  (cost=0.00..2500.73 rows=368 width=4) (actual time=8.990..17.730 rows=365 loops=1)
                                             Filter: ((d_month_seq >= 1188) AND (d_month_seq <= 1199))
                                             Rows Removed by Filter: 72684
                                             Buffers: shared hit=1405
                                       ->  Index Scan using catalog_sales_cs_ship_date_sk_idx on catalog_sales  (cost=0.43..881.31 rows=7496 width=20) (actual time=0.017..8.560 rows=7813 loops=365)
                                             Index Cond: (cs_ship_date_sk = date_dim.d_date_sk)
                                             Buffers: shared hit=2330604
                                 ->  Hash  (cost=1.20..1.20 rows=20 width=35) (actual time=0.016..0.017 rows=20 loops=1)
                                       Buckets: 1024  Batches: 1  Memory Usage: 10kB
                                       Buffers: shared hit=1
                                       ->  Seq Scan on ship_mode  (cost=0.00..1.20 rows=20 width=35) (actual time=0.004..0.008 rows=20 loops=1)
                                             Buffers: shared hit=1
                           ->  Hash  (cost=2.24..2.24 rows=24 width=18) (actual time=0.023..0.024 rows=24 loops=1)
                                 Buckets: 1024  Batches: 1  Memory Usage: 10kB
                                 Buffers: shared hit=2
                                 ->  Seq Scan on call_center  (cost=0.00..2.24 rows=24 width=18) (actual time=0.004..0.013 rows=24 loops=1)
                                       Buffers: shared hit=2
                     ->  Hash  (cost=1.10..1.10 rows=10 width=21) (actual time=0.017..0.018 rows=10 loops=1)
                           Buckets: 1024  Batches: 1  Memory Usage: 9kB
                           Buffers: shared hit=1
                           ->  Seq Scan on warehouse  (cost=0.00..1.10 rows=10 width=21) (actual time=0.006..0.008 rows=10 loops=1)
                                 Buffers: shared hit=1
 Planning:
   Buffers: shared hit=620
 Planning Time: 3.657 ms
 Execution Time: 13285.414 ms
(47 rows)

