QUERY PLAN --------------------------------------------------------------------------------------------------------------- Limit -> Aggregate -> Hash Join Hash Cond: (part.p_partkey = lineitem_1.l_partkey) Join Filter: (lineitem.l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) -> Gather Workers Planned: 2 -> Nested Loop -> Parallel Seq Scan on part Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) -> Index Scan using idx_lineitem_part_supp on lineitem Index Cond: (l_partkey = part.p_partkey) -> Hash -> Finalize HashAggregate Group Key: lineitem_1.l_partkey -> Gather Workers Planned: 2 -> Partial HashAggregate Group Key: lineitem_1.l_partkey -> Parallel Seq Scan on lineitem lineitem_1 (20 rows) QUERY PLAN --------------------------------------------------------------------------------------------------------------------- Limit -> Finalize Aggregate -> Gather Workers Planned: 5 -> Partial Aggregate -> Nested Loop Join Filter: (part.p_partkey = lineitem.l_partkey) -> Hash Join Hash Cond: (part.p_partkey = lineitem_1.l_partkey) -> Parallel Seq Scan on part Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) -> Hash -> HashAggregate Group Key: lineitem_1.l_partkey -> Seq Scan on lineitem lineitem_1 -> Index Scan using idx_lineitem_part_supp on lineitem Index Cond: (l_partkey = lineitem_1.l_partkey) Filter: (l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) (18 rows) QUERY PLAN --------------------------------------------------------------------------------------------------------------------- Limit -> Aggregate -> Merge Join Merge Cond: (lineitem_1.l_partkey = part.p_partkey) Join Filter: (lineitem.l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) -> Finalize GroupAggregate Group Key: lineitem_1.l_partkey -> Gather Merge Workers Planned: 8 -> Partial GroupAggregate Group Key: lineitem_1.l_partkey -> Sort Sort Key: lineitem_1.l_partkey -> Parallel Seq Scan on lineitem lineitem_1 -> Materialize -> Gather Merge Workers Planned: 6 -> Nested Loop -> Parallel Index Scan using part_pkey on part Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) -> Index Scan using idx_lineitem_part_supp on lineitem Index Cond: (l_partkey = part.p_partkey) (22 rows) QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------- Limit (cost=9323493.08..9323493.10 rows=1 width=32) -> Aggregate (cost=9323493.08..9323493.10 rows=1 width=32) -> Hash Join (cost=8690894.07..9323348.15 rows=57973 width=8) Hash Cond: (part.p_partkey = lineitem_1.l_partkey) Join Filter: (lineitem.l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) -> Gather (cost=1000.57..587448.17 rows=201706 width=21) Workers Planned: 2 -> Nested Loop (cost=0.57..566277.57 rows=84044 width=21) -> Parallel Seq Scan on part (cost=0.00..171069.18 rows=2802 width=4) Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) -> Index Scan using idx_lineitem_part_supp on lineitem (cost=0.57..140.70 rows=35 width=17) Index Cond: (l_partkey = part.p_partkey) -> Hash (cost=8577801.28..8577801.28 rows=5518338 width=36) -> Finalize HashAggregate (cost=8353618.79..8522617.90 rows=5518338 width=36) Group Key: lineitem_1.l_partkey Planned Partitions: 16 -> Gather (cost=6362701.20..7925947.60 rows=11036676 width=36) Workers Planned: 2 -> Partial HashAggregate (cost=6361701.20..6821280.00 rows=5518338 width=36) Group Key: lineitem_1.l_partkey Planned Partitions: 16 -> Parallel Seq Scan on lineitem lineitem_1 (cost=0.00..4399328.93 rows=79994793 width=9) (22 rows) QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- Limit (cost=11757514.10..11757514.11 rows=1 width=32) -> Finalize Aggregate (cost=11757514.10..11757514.11 rows=1 width=32) -> Gather (cost=11757513.56..11757514.07 rows=5 width=32) Workers Planned: 5 -> Partial Aggregate (cost=11756513.56..11756513.57 rows=1 width=32) -> Nested Loop (cost=11416439.73..11756484.57 rows=11595 width=8) Join Filter: (part.p_partkey = lineitem.l_partkey) -> Hash Join (cost=11416439.16..11609836.77 rows=1160 width=40) Hash Cond: (part.p_partkey = lineitem_1.l_partkey) -> Parallel Seq Scan on part (cost=0.00..150269.09 rows=1345 width=4) Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) -> Hash (cost=11304346.93..11304346.93 rows=5518338 width=36) -> HashAggregate (cost=10228949.50..11249163.55 rows=5518338 width=36) Group Key: lineitem_1.l_partkey Planned Partitions: 16 -> Seq Scan on lineitem lineitem_1 (cost=0.00..5519256.04 rows=191987504 width=9) -> Index Scan using idx_lineitem_part_supp on lineitem (cost=0.57..126.27 rows=12 width=17) Index Cond: (l_partkey = lineitem_1.l_partkey) Filter: (l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) (19 rows) QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------- Limit (cost=13805808.43..13805808.44 rows=1 width=32) -> Aggregate (cost=13805808.43..13805808.44 rows=1 width=32) -> Merge Join (cost=7193277.61..13805663.49 rows=57973 width=8) Merge Cond: (lineitem_1.l_partkey = part.p_partkey) Join Filter: (lineitem.l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) -> Finalize GroupAggregate (cost=7192276.51..13300598.75 rows=5518338 width=36) Group Key: lineitem_1.l_partkey -> Gather Merge (cost=7192276.51..12886723.40 rows=44146704 width=36) Workers Planned: 8 -> Partial GroupAggregate (cost=7191276.37..7440243.88 rows=5518338 width=36) Group Key: lineitem_1.l_partkey -> Sort (cost=7191276.37..7251272.46 rows=23998438 width=9) Sort Key: lineitem_1.l_partkey -> Parallel Seq Scan on lineitem lineitem_1 (cost=0.00..3839365.38 rows=23998438 width=9) -> Materialize (cost=1001.10..433407.27 rows=201706 width=21) -> Gather Merge (cost=1001.10..432903.01 rows=201706 width=21) Workers Planned: 6 -> Nested Loop (cost=1.00..407388.21 rows=33618 width=21) -> Parallel Index Scan using part_pkey on part (cost=0.43..249276.65 rows=1121 width=4) Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) -> Index Scan using idx_lineitem_part_supp on lineitem (cost=0.57..140.70 rows=35 width=17) Index Cond: (l_partkey = part.p_partkey) (22 rows)