BEGIN; BEGIN EXPLAIN select 100.00 * sum(case when p_type like 'PROMO%' then l_extendedprice * (1 - l_discount) else 0 end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue from lineitem, part where l_partkey = p_partkey and l_shipdate >= date '1996-02-01' and l_shipdate < cast(date '1996-02-01' + interval '1 month' as date); QUERY PLAN -------------------------------------------------------------------------------------------------------------- Finalize Aggregate (cost=1610577.35..1610577.36 rows=1 width=32) -> Gather (cost=1610577.11..1610577.32 rows=2 width=64) Workers Planned: 2 -> Partial Aggregate (cost=1609577.11..1609577.12 rows=1 width=64) -> Parallel Hash Join (cost=65410.40..1604490.01 rows=290691 width=33) Hash Cond: (lineitem.l_partkey = part.p_partkey) -> Parallel Seq Scan on lineitem (cost=0.00..1529779.55 rows=290691 width=16) Filter: ((l_shipdate >= '1996-02-01'::date) AND (l_shipdate < '1996-03-01'::date)) -> Parallel Hash (cost=49296.51..49296.51 rows=833351 width=25) -> Parallel Seq Scan on part (cost=0.00..49296.51 rows=833351 width=25) (10 rows) COMMIT; COMMIT