                                                                                                             QUERY PLAN                                                                                                             
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=1217946.37..1217949.68 rows=100 width=160) (actual time=20299.177..20299.549 rows=100 loops=1)
   Buffers: shared hit=4362769
   ->  GroupAggregate  (cost=1217946.37..1217959.65 rows=401 width=160) (actual time=20299.175..20299.532 rows=100 loops=1)
         Group Key: ('store channel'::text), (('store'::text || (ssr.store_id)::text))
         Group Key: ('store channel'::text)
         Group Key: ()
         Buffers: shared hit=4362769
         ->  Sort  (cost=1217946.37..1217947.41 rows=418 width=160) (actual time=20299.162..20299.194 rows=101 loops=1)
               Sort Key: ('store channel'::text), (('store'::text || (ssr.store_id)::text))
               Sort Method: quicksort  Memory: 95kB
               Buffers: shared hit=4362769
               ->  Append  (cost=896102.82..1217928.17 rows=418 width=160) (actual time=14414.922..20296.255 rows=504 loops=1)
                     Buffers: shared hit=4362766
                     ->  Subquery Scan on ssr  (cost=896102.82..896113.64 rows=51 width=160) (actual time=14414.921..14442.880 rows=51 loops=1)
                           Buffers: shared hit=2514563
                           ->  GroupAggregate  (cost=896102.82..896112.87 rows=51 width=113) (actual time=14414.914..14442.834 rows=51 loops=1)
                                 Group Key: store.s_store_id
                                 Buffers: shared hit=2514563
                                 ->  Sort  (cost=896102.82..896104.34 rows=611 width=41) (actual time=14414.397..14417.243 rows=32221 loops=1)
                                       Sort Key: store.s_store_id
                                       Sort Method: quicksort  Memory: 3286kB
                                       Buffers: shared hit=2514563
                                       ->  Nested Loop Left Join  (cost=2509.44..896074.54 rows=611 width=41) (actual time=18.399..14363.261 rows=32221 loops=1)
                                             Buffers: shared hit=2514560
                                             ->  Nested Loop  (cost=2509.01..895302.54 rows=611 width=37) (actual time=18.382..14143.572 rows=32221 loops=1)
                                                   Buffers: shared hit=2414750
                                                   ->  Nested Loop  (cost=2508.73..894912.14 rows=651 width=41) (actual time=18.368..14019.971 rows=33138 loops=1)
                                                         Buffers: shared hit=2316593
                                                         ->  Hash Join  (cost=2508.44..883067.04 rows=11871 width=41) (actual time=17.742..11216.182 rows=599425 loops=1)
                                                               Hash Cond: (store_sales.ss_store_sk = store.s_store_sk)
                                                               Buffers: shared hit=518318
                                                               ->  Hash Join  (cost=2501.15..883025.85 rows=12419 width=28) (actual time=17.631..10930.475 rows=613805 loops=1)
                                                                     Hash Cond: (store_sales.ss_sold_date_sk = date_dim.d_date_sk)
                                                                     Buffers: shared hit=518313
                                                                     ->  Seq Scan on store_sales  (cost=0.00..804917.92 rows=28800992 width=32) (actual time=0.004..3889.654 rows=28800991 loops=1)
                                                                           Buffers: shared hit=516908
                                                                     ->  Hash  (cost=2500.73..2500.73 rows=33 width=4) (actual time=17.575..17.576 rows=31 loops=1)
                                                                           Buckets: 1024  Batches: 1  Memory Usage: 10kB
                                                                           Buffers: shared hit=1405
                                                                           ->  Seq Scan on date_dim  (cost=0.00..2500.73 rows=33 width=4) (actual time=8.877..17.561 rows=31 loops=1)
                                                                                 Filter: ((d_date >= '2002-08-04'::date) AND (d_date <= '2002-09-03 00:00:00'::timestamp without time zone))
                                                                                 Rows Removed by Filter: 73018
                                                                                 Buffers: shared hit=1405
                                                               ->  Hash  (cost=6.02..6.02 rows=102 width=21) (actual time=0.096..0.097 rows=102 loops=1)
                                                                     Buckets: 1024  Batches: 1  Memory Usage: 14kB
                                                                     Buffers: shared hit=5
                                                                     ->  Seq Scan on store  (cost=0.00..6.02 rows=102 width=21) (actual time=0.009..0.059 rows=102 loops=1)
                                                                           Buffers: shared hit=5
                                                         ->  Index Scan using item_pkey on item  (cost=0.29..1.00 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=599425)
                                                               Index Cond: (i_item_sk = store_sales.ss_item_sk)
                                                               Filter: (i_current_price > '50'::numeric)
                                                               Rows Removed by Filter: 1
                                                               Buffers: shared hit=1798275
                                                   ->  Index Scan using promotion_pkey on promotion  (cost=0.27..0.60 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=33138)
                                                         Index Cond: (p_promo_sk = store_sales.ss_promo_sk)
                                                         Filter: (p_channel_tv = 'N'::bpchar)
                                                         Rows Removed by Filter: 0
                                                         Buffers: shared hit=98157
                                             ->  Index Scan using store_returns_pkey on store_returns  (cost=0.43..1.26 rows=1 width=20) (actual time=0.006..0.006 rows=0 loops=32221)
                                                   Index Cond: ((sr_item_sk = store_sales.ss_item_sk) AND (sr_ticket_number = store_sales.ss_ticket_number))
                                                   Buffers: shared hit=99810
                     ->  Subquery Scan on csr  (cost=39497.96..39514.40 rows=346 width=160) (actual time=1939.898..1956.437 rows=432 loops=1)
                           Buffers: shared hit=1130308
                           ->  GroupAggregate  (cost=39497.96..39509.21 rows=346 width=113) (actual time=1939.893..1956.111 rows=432 loops=1)
                                 Group Key: catalog_page.cp_catalog_page_id
                                 Buffers: shared hit=1130308
                                 ->  Sort  (cost=39497.96..39498.83 rows=346 width=41) (actual time=1939.806..1941.373 rows=17422 loops=1)
                                       Sort Key: catalog_page.cp_catalog_page_id
                                       Sort Method: quicksort  Memory: 2131kB
                                       Buffers: shared hit=1130308
                                       ->  Nested Loop Left Join  (cost=1.71..39483.37 rows=346 width=41) (actual time=7.702..1900.196 rows=17422 loops=1)
                                             Buffers: shared hit=1130308
                                             ->  Nested Loop  (cost=1.29..39325.30 rows=346 width=37) (actual time=7.683..1801.483 rows=17422 loops=1)
                                                   Buffers: shared hit=1076253
                                                   ->  Nested Loop  (cost=1.00..39220.00 rows=348 width=24) (actual time=7.651..1739.254 rows=17448 loops=1)
                                                         Buffers: shared hit=1023987
                                                         ->  Nested Loop  (cost=0.73..39116.18 rows=355 width=28) (actual time=7.636..1675.211 rows=17779 loops=1)
                                                               Buffers: shared hit=970779
                                                               ->  Nested Loop  (cost=0.43..37080.66 rows=6472 width=28) (actual time=7.336..341.619 rows=320131 loops=1)
                                                                     Buffers: shared hit=10386
                                                                     ->  Seq Scan on date_dim date_dim_1  (cost=0.00..2500.73 rows=33 width=4) (actual time=7.278..15.346 rows=31 loops=1)
                                                                           Filter: ((d_date >= '2002-08-04'::date) AND (d_date <= '2002-09-03 00:00:00'::timestamp without time zone))
                                                                           Rows Removed by Filter: 73018
                                                                           Buffers: shared hit=1405
                                                                     ->  Index Scan using catalog_sales_cs_sold_date_sk_idx on catalog_sales  (cost=0.43..969.76 rows=7812 width=32) (actual time=0.019..4.885 rows=10327 loops=31)
                                                                           Index Cond: (cs_sold_date_sk = date_dim_1.d_date_sk)
                                                                           Buffers: shared hit=8981
                                                               ->  Index Scan using item_pkey on item item_1  (cost=0.29..0.31 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=320131)
                                                                     Index Cond: (i_item_sk = catalog_sales.cs_item_sk)
                                                                     Filter: (i_current_price > '50'::numeric)
                                                                     Rows Removed by Filter: 1
                                                                     Buffers: shared hit=960393
                                                         ->  Index Scan using promotion_pkey on promotion promotion_1  (cost=0.27..0.29 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=17779)
                                                               Index Cond: (p_promo_sk = catalog_sales.cs_promo_sk)
                                                               Filter: (p_channel_tv = 'N'::bpchar)
                                                               Rows Removed by Filter: 0
                                                               Buffers: shared hit=53208
                                                   ->  Index Scan using catalog_page_pkey on catalog_page  (cost=0.29..0.30 rows=1 width=21) (actual time=0.003..0.003 rows=1 loops=17448)
                                                         Index Cond: (cp_catalog_page_sk = catalog_sales.cs_catalog_page_sk)
                                                         Buffers: shared hit=52266
                                             ->  Index Scan using catalog_returns_pkey on catalog_returns  (cost=0.43..0.46 rows=1 width=20) (actual time=0.005..0.005 rows=0 loops=17422)
                                                   Index Cond: ((cr_item_sk = catalog_sales.cs_item_sk) AND (cr_order_number = catalog_sales.cs_order_number))
                                                   Buffers: shared hit=54055
                     ->  Subquery Scan on wsr  (cost=282294.73..282298.04 rows=21 width=160) (actual time=3889.460..3896.851 rows=21 loops=1)
                           Buffers: shared hit=717895
                           ->  GroupAggregate  (cost=282294.73..282297.73 rows=21 width=113) (actual time=3889.455..3896.826 rows=21 loops=1)
                                 Group Key: web_site.web_site_id
                                 Buffers: shared hit=717895
                                 ->  Sort  (cost=282294.73..282295.17 rows=175 width=41) (actual time=3889.078..3889.848 rows=8720 loops=1)
                                       Sort Key: web_site.web_site_id
                                       Sort Method: quicksort  Memory: 1066kB
                                       Buffers: shared hit=717895
                                       ->  Hash Join  (cost=2506.08..282288.21 rows=175 width=41) (actual time=15.887..3877.099 rows=8720 loops=1)
                                             Hash Cond: (web_sales.ws_web_site_sk = web_site.web_site_sk)
                                             Buffers: shared hit=717895
                                             ->  Nested Loop Left Join  (cost=2502.14..282283.77 rows=175 width=28) (actual time=15.821..3871.717 rows=8720 loops=1)
                                                   Buffers: shared hit=717892
                                                   ->  Nested Loop  (cost=2501.71..282204.36 rows=175 width=24) (actual time=15.804..3818.486 rows=8720 loops=1)
                                                         Buffers: shared hit=690849
                                                         ->  Nested Loop  (cost=2501.44..282152.30 rows=178 width=28) (actual time=15.790..3784.622 rows=8871 loops=1)
                                                               Buffers: shared hit=664239
                                                               ->  Hash Join  (cost=2501.15..281123.59 rows=3250 width=28) (actual time=15.583..3052.911 rows=158362 loops=1)
                                                                     Hash Cond: (web_sales.ws_sold_date_sk = date_dim_2.d_date_sk)
                                                                     Buffers: shared hit=189153
                                                                     ->  Seq Scan on web_sales  (cost=0.00..259726.89 rows=7197889 width=32) (actual time=0.004..1021.353 rows=7197566 loops=1)
                                                                           Buffers: shared hit=187748
                                                                     ->  Hash  (cost=2500.73..2500.73 rows=33 width=4) (actual time=15.201..15.201 rows=31 loops=1)
                                                                           Buckets: 1024  Batches: 1  Memory Usage: 10kB
                                                                           Buffers: shared hit=1405
                                                                           ->  Seq Scan on date_dim date_dim_2  (cost=0.00..2500.73 rows=33 width=4) (actual time=7.613..15.187 rows=31 loops=1)
                                                                                 Filter: ((d_date >= '2002-08-04'::date) AND (d_date <= '2002-09-03 00:00:00'::timestamp without time zone))
                                                                                 Rows Removed by Filter: 73018
                                                                                 Buffers: shared hit=1405
                                                               ->  Index Scan using item_pkey on item item_2  (cost=0.29..0.32 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=158362)
                                                                     Index Cond: (i_item_sk = web_sales.ws_item_sk)
                                                                     Filter: (i_current_price > '50'::numeric)
                                                                     Rows Removed by Filter: 1
                                                                     Buffers: shared hit=475086
                                                         ->  Index Scan using promotion_pkey on promotion promotion_2  (cost=0.27..0.29 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=8871)
                                                               Index Cond: (p_promo_sk = web_sales.ws_promo_sk)
                                                               Filter: (p_channel_tv = 'N'::bpchar)
                                                               Rows Removed by Filter: 0
                                                               Buffers: shared hit=26610
                                                   ->  Index Scan using web_returns_pkey on web_returns  (cost=0.42..0.45 rows=1 width=20) (actual time=0.005..0.005 rows=0 loops=8720)
                                                         Index Cond: ((wr_item_sk = web_sales.ws_item_sk) AND (wr_order_number = web_sales.ws_order_number))
                                                         Buffers: shared hit=27043
                                             ->  Hash  (cost=3.42..3.42 rows=42 width=21) (actual time=0.045..0.045 rows=42 loops=1)
                                                   Buckets: 1024  Batches: 1  Memory Usage: 11kB
                                                   Buffers: shared hit=3
                                                   ->  Seq Scan on web_site  (cost=0.00..3.42 rows=42 width=21) (actual time=0.012..0.027 rows=42 loops=1)
                                                         Buffers: shared hit=3
 Planning:
   Buffers: shared hit=1599
 Planning Time: 12.010 ms
 Execution Time: 20300.812 ms
(155 rows)

