                                                                                              QUERY PLAN                                                                                              
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=364100.74..364100.99 rows=100 width=117) (actual time=16587.119..16587.142 rows=100 loops=1)
   Buffers: shared hit=2332099
   ->  Sort  (cost=364100.74..364102.36 rows=648 width=117) (actual time=16587.116..16587.127 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=2332099
         ->  HashAggregate  (cost=364067.87..364075.97 rows=648 width=117) (actual time=16585.720..16586.037 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=2332093
               ->  Nested Loop  (cost=0.88..359803.43 rows=71074 width=85) (actual time=9.348..12391.946 rows=2839008 loops=1)
                     Buffers: shared hit=2332093
                     ->  Nested Loop  (cost=0.73..357876.80 rows=71438 width=60) (actual time=9.338..9099.099 rows=2840798 loops=1)
                           Buffers: shared hit=2332069
                           ->  Nested Loop  (cost=0.58..356126.52 rows=71821 width=33) (actual time=9.329..6768.218 rows=2844374 loops=1)
                                 Buffers: shared hit=2332029
                                 ->  Nested Loop  (cost=0.43..354407.98 rows=72201 width=20) (actual time=9.315..4210.351 rows=2851680 loops=1)
                                       Buffers: shared hit=2332009
                                       ->  Seq Scan on date_dim  (cost=0.00..2500.73 rows=368 width=4) (actual time=9.267..18.636 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.018..8.595 rows=7813 loops=365)
                                             Index Cond: (cs_ship_date_sk = date_dim.d_date_sk)
                                             Buffers: shared hit=2330604
                                 ->  Result Cache  (cost=0.15..0.16 rows=1 width=21) (actual time=0.000..0.000 rows=1 loops=2851680)
                                       Cache Key: catalog_sales.cs_warehouse_sk
                                       Hits: 2851669  Misses: 11  Evictions: 0  Overflows: 0  Memory Usage: 2kB
                                       Buffers: shared hit=20
                                       ->  Index Scan using warehouse_pkey on warehouse  (cost=0.14..0.15 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=11)
                                             Index Cond: (w_warehouse_sk = catalog_sales.cs_warehouse_sk)
                                             Buffers: shared hit=20
                           ->  Result Cache  (cost=0.15..0.17 rows=1 width=35) (actual time=0.000..0.000 rows=1 loops=2844374)
                                 Cache Key: catalog_sales.cs_ship_mode_sk
                                 Hits: 2844353  Misses: 21  Evictions: 0  Overflows: 0  Memory Usage: 3kB
                                 Buffers: shared hit=40
                                 ->  Index Scan using ship_mode_pkey on ship_mode  (cost=0.14..0.16 rows=1 width=35) (actual time=0.002..0.002 rows=1 loops=21)
                                       Index Cond: (sm_ship_mode_sk = catalog_sales.cs_ship_mode_sk)
                                       Buffers: shared hit=40
                     ->  Result Cache  (cost=0.15..0.17 rows=1 width=18) (actual time=0.000..0.000 rows=1 loops=2840798)
                           Cache Key: catalog_sales.cs_call_center_sk
                           Hits: 2840785  Misses: 13  Evictions: 0  Overflows: 0  Memory Usage: 2kB
                           Buffers: shared hit=24
                           ->  Index Scan using call_center_pkey on call_center  (cost=0.14..0.16 rows=1 width=18) (actual time=0.002..0.002 rows=1 loops=13)
                                 Index Cond: (cc_call_center_sk = catalog_sales.cs_call_center_sk)
                                 Buffers: shared hit=24
 Planning:
   Buffers: shared hit=620
 Planning Time: 4.411 ms
 Execution Time: 16587.834 ms
(50 rows)

