QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=9628616.99..9628617.00 rows=1 width=32) (actual time=186382.616..186382.616 rows=1 loops=1) -> Aggregate (cost=9628616.99..9628617.00 rows=1 width=32) (actual time=186382.615..186382.615 rows=1 loops=1) -> Nested Loop (cost=8846746.78..9628472.06 rows=57973 width=8) (actual time=117876.966..186370.093 rows=17275 loops=1) Join Filter: (part.p_partkey = lineitem.l_partkey) -> Hash Join (cost=8846746.21..9257862.40 rows=5798 width=40) (actual time=117874.862..158676.425 rows=6431 loops=1) Hash Cond: (lineitem_1.l_partkey = part.p_partkey) -> Finalize HashAggregate (cost=8694720.67..9036167.83 rows=5518338 width=36) (actual time=116983.030..157039.065 rows=6400000 loops=1) Group Key: lineitem_1.l_partkey Planned Partitions: 16 Peak Memory Usage: 237713 kB Disk Usage: 2574336 kB HashAgg Batches: 528 -> Gather (cost=4392829.42..7929051.27 rows=33110028 width=36) (actual time=34827.589..90325.640 rows=44196557 loops=1) Workers Planned: 6 Workers Launched: 6 -> Partial HashAggregate (cost=4391829.42..4617048.47 rows=5518338 width=36) (actual time=34870.679..92227.836 rows=6313794 loops=7) Group Key: lineitem_1.l_partkey Planned Partitions: 16 Peak Memory Usage: 131217 kB Disk Usage: 739328 kB HashAgg Batches: 208 -> Parallel Seq Scan on lineitem lineitem_1 (cost=0.00..3919360.17 rows=31997917 width=9) (actual time=1.011..11798.355 rows=27428650 loops=7) -> Hash (cost=151941.49..151941.49 rows=6724 width=4) (actual time=891.150..891.150 rows=6431 loops=1) Buckets: 8192 Batches: 1 Memory Usage: 291kB -> Gather (cost=1000.00..151941.49 rows=6724 width=4) (actual time=1.533..889.103 rows=6431 loops=1) Workers Planned: 5 Workers Launched: 5 -> Parallel Seq Scan on part (cost=0.00..150269.09 rows=1345 width=4) (actual time=2.381..878.871 rows=1072 loops=6) Filter: ((p_brand = 'Brand#22'::bpchar) AND (p_container = 'LG BOX'::bpchar)) Rows Removed by Filter: 1065595 -> Index Scan using idx_lineitem_part_supp on lineitem (cost=0.57..63.77 rows=12 width=17) (actual time=1.541..4.303 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.364 ms Execution Time: 186599.047 ms (36 rows)