                                                                  QUERY PLAN                                                                   
-----------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=107004.72..107004.73 rows=1 width=32)
   ->  Aggregate  (cost=107004.72..107004.73 rows=1 width=32)
         ->  Hash Join  (cost=8240.55..107004.71 rows=5 width=6)
               Hash Cond: (catalog_sales.cs_item_sk = item.i_item_sk)
               Join Filter: (catalog_sales.cs_ext_discount_amt > (SubPlan 1))
               ->  Nested Loop  (cost=0.43..98716.71 rows=18240 width=10)
                     ->  Seq Scan on date_dim  (cost=0.00..2500.73 rows=93 width=4)
                           Filter: ((d_date >= '1999-02-22'::date) AND (d_date <= '1999-05-23 00:00:00'::timestamp without time zone))
                     ->  Index Scan using catalog_sales_cs_sold_date_sk_idx on catalog_sales  (cost=0.43..956.46 rows=7812 width=14)
                           Index Cond: (cs_sold_date_sk = date_dim.d_date_sk)
               ->  Hash  (cost=8239.00..8239.00 rows=89 width=4)
                     ->  Seq Scan on item  (cost=0.00..8239.00 rows=89 width=4)
                           Filter: (i_manufact_id = 283)
               SubPlan 1
                 ->  Aggregate  (cost=1903.89..1903.90 rows=1 width=32)
                       ->  Nested Loop  (cost=6.08..1903.88 rows=1 width=6)
                             ->  Bitmap Heap Scan on catalog_sales catalog_sales_1  (cost=5.79..696.62 rows=175 width=10)
                                   Recheck Cond: (cs_item_sk = item.i_item_sk)
                                   ->  Bitmap Index Scan on catalog_sales_cs_item_sk_idx  (cost=0.00..5.75 rows=175 width=0)
                                         Index Cond: (cs_item_sk = item.i_item_sk)
                             ->  Index Scan using date_dim_pkey on date_dim date_dim_1  (cost=0.29..6.90 rows=1 width=4)
                                   Index Cond: (d_date_sk = catalog_sales_1.cs_sold_date_sk)
                                   Filter: ((d_date >= '1999-02-22'::date) AND (d_date <= '1999-05-23 00:00:00'::timestamp without time zone))
(23 rows)

