QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=9810135.83..9810135.85 rows=1 width=32) (actual time=496902.294..496902.295 rows=1 loops=1) -> Finalize Aggregate (cost=9810135.83..9810135.85 rows=1 width=32) (actual time=496902.292..496902.292 rows=1 loops=1) -> Gather (cost=9810135.30..9810135.81 rows=5 width=32) (actual time=485494.442..496905.736 rows=6 loops=1) Workers Planned: 5 Workers Launched: 5 -> Partial Aggregate (cost=9809135.30..9809135.31 rows=1 width=32) (actual time=489336.187..489336.187 rows=1 loops=6) -> Nested Loop (cost=9541561.76..9809106.31 rows=11595 width=8) (actual time=482245.584..489334.183 rows=2879 loops=6) Join Filter: (part.p_partkey = lineitem.l_partkey) -> Hash Join (cost=9541561.19..9734958.81 rows=1160 width=40) (actual time=482243.642..484209.161 rows=1072 loops=6) Hash Cond: (part.p_partkey = lineitem_1.l_partkey) -> Parallel Seq Scan on part (cost=0.00..150269.09 rows=1345 width=4) (actual time=0.350..217.852 rows=1072 loops=6) Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) Rows Removed by Filter: 1065595 -> Hash (cost=9429468.96..9429468.96 rows=5518338 width=36) (actual time=482108.072..482108.072 rows=6400000 loops=6) Buckets: 2097152 Batches: 4 Memory Usage: 92933kB -> HashAggregate (cost=8354071.53..9374285.58 rows=5518338 width=36) (actual time=254740.191..480275.566 rows=6400000 loops=6) Group Key: lineitem_1.l_partkey Planned Partitions: 16 Peak Memory Usage: 139409 kB Disk Usage: 5098496 kB HashAgg Batches: 1424 -> Seq Scan on lineitem lineitem_1 (cost=0.00..5519256.04 rows=191987504 width=9) (actual time=0.104..31016.587 rows=192000551 loops=6) -> Index Scan using idx_lineitem_part_supp on lineitem (cost=0.57..63.77 rows=12 width=17) (actual time=1.775..4.777 rows=3 loops=6431) Index Cond: (l_partkey = lineitem_1.l_partkey) Filter: (l_quantity < ((0.2 * avg(lineitem_1.l_quantity)))) Rows Removed by Filter: 27 Planning Time: 0.385 ms Execution Time: 497025.491 ms (28 rows)