explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 32Mb : Hashjoin

Settings
# exclusive inclusive rows x rows loops node
1. 82.849 1,688.961 ↑ 6.0 9,772 1

Unique (cost=666,926.79..667,221.84 rows=59,011 width=32) (actual time=1,464.935..1,688.961 rows=9,772 loops=1)

2. 877.607 1,606.112 ↓ 2.0 118,401 1

Sort (cost=666,926.79..667,074.31 rows=59,011 width=32) (actual time=1,464.932..1,606.112 rows=118,401 loops=1)

  • Sort Key: (ROW(r.a, r.b, r.c, s.d))
  • Sort Method: external merge Disk: 5456kB
3. 22.058 728.505 ↓ 2.0 118,401 1

Gather (cost=464,222.47..662,250.55 rows=59,011 width=32) (actual time=534.476..728.505 rows=118,401 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 117.841 706.447 ↓ 1.7 59,200 2 / 2

Hash Join (cost=463,222.47..655,349.45 rows=34,712 width=32) (actual time=536.630..706.447 rows=59,200 loops=2)

  • Hash Cond: ((r.b = s.b) AND (r.c = s.c) AND (r.a = t.a))
5. 52.815 52.815 ↑ 1.2 250,000 2 / 2

Parallel Seq Scan on r (cost=0.00..5,644.18 rows=294,118 width=12) (actual time=0.090..52.815 rows=250,000 loops=2)

6. 13.530 535.791 ↓ 2.0 30,377 2 / 2

Hash (cost=462,962.31..462,962.31 rows=14,866 width=28) (actual time=535.791..535.791 rows=30,377 loops=2)

  • Buckets: 32768 (originally 16384) Batches: 1 (originally 1) Memory Usage: 2036kB
7. 82.100 522.261 ↓ 2.0 30,377 2 / 2

Hash Join (cost=135,149.65..462,962.31 rows=14,866 width=28) (actual time=435.149..522.261 rows=30,377 loops=2)

  • Hash Cond: ((t.c = s.c) AND (t.a = u.a) AND (t.d = s.d))
8. 5.576 5.576 ↑ 1.0 20,000 2 / 2

Seq Scan on t (cost=0.00..309.00 rows=20,000 width=12) (actual time=0.038..5.576 rows=20,000 loops=2)

9. 155.090 434.585 ↑ 1.0 384,259 2 / 2

Hash (cost=126,145.42..126,145.42 rows=385,442 width=24) (actual time=434.585..434.585 rows=384,259 loops=2)

  • Buckets: 65536 Batches: 8 Memory Usage: 3143kB
10. 169.895 279.495 ↑ 1.0 384,259 2 / 2

Hash Join (cost=7,059.00..126,145.42 rows=385,442 width=24) (actual time=104.391..279.495 rows=384,259 loops=2)

  • Hash Cond: ((u.b = s.b) AND (u.d = s.d))
11. 6.028 6.028 ↑ 1.0 20,000 2 / 2

Seq Scan on u (cost=0.00..309.00 rows=20,000 width=12) (actual time=0.038..6.028 rows=20,000 loops=2)

12. 62.503 103.572 ↑ 1.0 200,000 2 / 2

Hash (cost=3,082.00..3,082.00 rows=200,000 width=12) (actual time=103.572..103.572 rows=200,000 loops=2)

  • Buckets: 131072 Batches: 4 Memory Usage: 3178kB
13. 41.069 41.069 ↑ 1.0 200,000 2 / 2

Seq Scan on s (cost=0.00..3,082.00 rows=200,000 width=12) (actual time=0.037..41.069 rows=200,000 loops=2)

Planning time : 2.802 ms
Execution time : 1,692.289 ms