QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=4642943.81..4642943.82 rows=1 width=34) (actual time=39806.068..39806.080 rows=100 loops=1) -> Sort (cost=4642943.81..4642943.82 rows=1 width=34) (actual time=39806.064..39806.070 rows=100 loops=1) Sort Key: (count(*)) DESC, supplier.s_name Sort Method: top-N heapsort Memory: 38kB -> GroupAggregate (cost=4642943.78..4642943.80 rows=1 width=34) (actual time=39796.916..39804.615 rows=3945 loops=1) Group Key: supplier.s_name -> Sort (cost=4642943.78..4642943.79 rows=1 width=26) (actual time=39796.906..39800.147 rows=38905 loops=1) Sort Key: supplier.s_name Sort Method: quicksort Memory: 4576kB -> Nested Loop Anti Join (cost=2861152.85..4642943.77 rows=1 width=26) (actual time=19851.808..39565.632 rows=38905 loops=1) -> Nested Loop (cost=2861152.29..4642900.65 rows=1 width=42) (actual time=19850.550..35747.936 rows=696628 loops=1) -> Gather (cost=2861151.85..4642893.24 rows=1 width=50) (actual time=19850.323..29654.121 rows=1441593 loops=1) Workers Planned: 3 Workers Launched: 3 -> Hash Semi Join (cost=2860151.85..4641893.14 rows=1 width=50) (actual time=21036.398..30323.561 rows=360398 loops=4) Hash Cond: (l1.l_orderkey = l2.l_orderkey) Join Filter: (l2.l_suppkey <> l1.l_suppkey) Rows Removed by Join Filter: 93610 -> Hash Join (cost=2585.58..1486212.61 rows=258004 width=42) (actual time=17.681..3985.606 rows=373726 loops=4) Hash Cond: (l1.l_suppkey = supplier.s_suppkey) -> Parallel Seq Scan on lineitem l1 (cost=0.00..1456859.08 rows=6450109 width=16) (actual time=0.031..2986.281 rows=9482337 loops=4) Filter: (l_receiptdate > l_commitdate) Rows Removed by Filter: 5514176 -> Hash (cost=2535.58..2535.58 rows=4000 width=30) (actual time=17.410..17.410 rows=3945 loops=4) Buckets: 4096 Batches: 1 Memory Usage: 279kB -> Nested Loop (cost=79.29..2535.58 rows=4000 width=30) (actual time=1.872..15.971 rows=3945 loops=4) -> Seq Scan on nation (cost=0.00..1.31 rows=1 width=4) (actual time=0.026..0.034 rows=1 loops=4) 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.838..14.950 rows=3945 loops=4) 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.309..1.309 rows=3945 loops=4) Index Cond: (s_nationkey = nation.n_nationkey) -> Hash (cost=1814840.12..1814840.12 rows=59986012 width=16) (actual time=20846.345..20846.345 rows=59986052 loops=4) Buckets: 33554432 Batches: 4 Memory Usage: 965240kB -> Seq Scan on lineitem l2 (cost=0.00..1814840.12 rows=59986012 width=16) (actual time=0.046..11007.730 rows=59986052 loops=4) -> Index Scan using orders_pkey on orders (cost=0.43..7.40 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=1441593) Index Cond: (o_orderkey = l1.l_orderkey) Filter: (o_orderstatus = 'F'::bpchar) Rows Removed by Filter: 1 -> Index Scan using idx_lineitem_orderkey on lineitem l3 (cost=0.56..21.58 rows=53 width=16) (actual time=0.005..0.005 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.970 ms Execution time: 39809.977 ms (47 rows)