QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=4216591.95..4216591.95 rows=1 width=34) (actual time=9489.945..9489.957 rows=100 loops=1) -> Sort (cost=4216591.95..4216591.95 rows=1 width=34) (actual time=9489.943..9489.949 rows=100 loops=1) Sort Key: (count(*)) DESC, supplier.s_name Sort Method: top-N heapsort Memory: 38kB -> GroupAggregate (cost=4216591.92..4216591.94 rows=1 width=34) (actual time=9480.290..9488.403 rows=3945 loops=1) Group Key: supplier.s_name -> Sort (cost=4216591.92..4216591.92 rows=1 width=26) (actual time=9480.278..9483.654 rows=38905 loops=1) Sort Key: supplier.s_name Sort Method: quicksort Memory: 4576kB -> Nested Loop Anti Join (cost=559157.24..4216591.91 rows=1 width=26) (actual time=4154.990..9198.379 rows=38905 loops=1) -> Gather (cost=559156.67..4216548.78 rows=1 width=42) (actual time=4153.557..7185.268 rows=696628 loops=1) Workers Planned: 4 Workers Launched: 4 -> Nested Loop Semi Join (cost=558156.67..4215548.68 rows=1 width=42) (actual time=4391.022..8656.693 rows=139326 loops=5) Join Filter: (l2.l_suppkey <> l1.l_suppkey) Rows Removed by Join Filter: 36246 -> Hash Join (cost=558156.11..1984566.52 rows=97950 width=46) (actual time=4390.978..7970.236 rows=144548 loops=5) Hash Cond: (l1.l_orderkey = orders.o_orderkey) -> Hash Join (cost=2585.58..1425767.03 rows=199953 width=42) (actual time=20.784..3405.518 rows=298981 loops=5) Hash Cond: (l1.l_suppkey = supplier.s_suppkey) -> Parallel Seq Scan on lineitem l1 (cost=0.00..1402436.29 rows=4998834 width=16) (actual time=0.040..2570.422 rows=7585870 loops=5) Filter: (l_receiptdate > l_commitdate) Rows Removed by Filter: 4411341 -> Hash (cost=2535.58..2535.58 rows=4000 width=30) (actual time=20.458..20.458 rows=3945 loops=5) Buckets: 4096 Batches: 1 Memory Usage: 279kB -> Nested Loop (cost=79.29..2535.58 rows=4000 width=30) (actual time=1.921..18.996 rows=3945 loops=5) -> Seq Scan on nation (cost=0.00..1.31 rows=1 width=4) (actual time=0.033..0.041 rows=1 loops=5) Filter: (n_name = 'ETHIOPIA'::bpchar) Rows Removed by Filter: 24 -> Bitmap Heap Scan on supplier (cost=79.29..2494.27 rows=4000 width=38) (actual time=1.881..17.968 rows=3945 loops=5) Recheck Cond: (s_nationkey = nation.n_nationkey) Heap Blocks: exact=1898 -> Bitmap Index Scan on idx_supplier_nation_key (cost=0.00..78.29 rows=4000 width=0) (actual time=1.363..1.363 rows=3945 loops=5) Index Cond: (s_nationkey = nation.n_nationkey) -> Hash (cost=463721.01..463721.01 rows=7347961 width=4) (actual time=4328.438..4328.438 rows=7309184 loops=5) Buckets: 8388608 Batches: 1 Memory Usage: 322500kB -> Seq Scan on orders (cost=0.00..463721.01 rows=7347961 width=4) (actual time=0.040..2856.374 rows=7309184 loops=5) Filter: (o_orderstatus = 'F'::bpchar) Rows Removed by Filter: 7690816 -> Index Scan using idx_lineitem_orderkey on lineitem l2 (cost=0.56..20.79 rows=159 width=16) (actual time=0.004..0.004 rows=1 loops=722740) Index Cond: (l_orderkey = orders.o_orderkey) -> Index Scan using idx_lineitem_orderkey on lineitem l3 (cost=0.56..21.58 rows=53 width=16) (actual time=0.003..0.003 rows=1 loops=696628) Index Cond: (l_orderkey = l1.l_orderkey) Filter: ((l_receiptdate > l_commitdate) AND (l_suppkey <> l1.l_suppkey)) Rows Removed by Filter: 1 Planning time: 4.495 ms Execution time: 9493.733 ms (47 rows)