explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zZxc

Settings
# exclusive inclusive rows x rows loops node
1. 81.478 3,726.110 ↑ 6.2 9,533 1

Unique (cost=102,225.06..102,521.87 rows=59,361 width=32) (actual time=3,519.832..3,726.110 rows=9,533 loops=1)

2. 1,447.900 3,644.632 ↓ 1.9 115,605 1

Sort (cost=102,225.06..102,373.46 rows=59,361 width=32) (actual time=3,519.829..3,644.632 rows=115,605 loops=1)

  • Sort Key: (ROW(r.a, r.b, r.c, s.d))
  • Sort Method: external merge Disk: 5328kB
3. 122.827 2,196.732 ↓ 1.9 115,605 1

Gather (cost=88,475.45..97,518.56 rows=59,361 width=32) (actual time=1,858.761..2,196.732 rows=115,605 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 90.936 2,073.905 ↓ 1.7 57,802 2 / 2

Merge Join (cost=87,475.45..90,582.46 rows=34,918 width=32) (actual time=1,900.477..2,073.905 rows=57,802 loops=2)

  • Merge Cond: ((r.b = s.b) AND (r.c = s.c) AND (r.a = t.a))
5. 676.365 783.919 ↑ 2.9 102,646 2 / 2

Sort (cost=37,388.47..38,123.76 rows=294,118 width=12) (actual time=724.428..783.919 rows=102,646 loops=2)

  • Sort Key: r.b, r.c, r.a
  • Sort Method: external merge Disk: 6064kB
  • Worker 0: Sort Method: external merge Disk: 4744kB
6. 107.554 107.554 ↑ 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.033..107.554 rows=250,000 loops=2)

7. 60.478 1,199.050 ↓ 4.1 62,334 2 / 2

Sort (cost=50,086.96..50,124.88 rows=15,168 width=28) (actual time=1,175.970..1,199.050 rows=62,334 loops=2)

  • Sort Key: s.b, s.c, t.a
  • Sort Method: quicksort Memory: 3092kB
  • Worker 0: Sort Method: quicksort Memory: 3092kB
8. 103.019 1,138.572 ↓ 2.0 29,742 2 / 2

Merge Join (cost=46,680.61..49,033.64 rows=15,168 width=28) (actual time=931.388..1,138.572 rows=29,742 loops=2)

  • Merge Cond: ((u.b = s.b) AND (t.c = s.c) AND (t.d = s.d))
9. 380.231 576.840 ↓ 1.0 153,391 2 / 2

Sort (cost=22,569.27..22,952.52 rows=153,301 width=24) (actual time=504.710..576.840 rows=153,391 loops=2)

  • Sort Key: u.b, t.c, t.d
  • Sort Method: external merge Disk: 5112kB
  • Worker 0: Sort Method: external merge Disk: 5112kB
10. 90.966 196.609 ↓ 1.0 153,391 2 / 2

Merge Join (cost=3,475.54..6,218.95 rows=153,301 width=24) (actual time=60.289..196.609 rows=153,391 loops=2)

  • Merge Cond: ((t.a = u.a) AND (t.d = u.d))
11. 28.618 38.438 ↑ 2.5 7,855 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=30.821..38.438 rows=7,855 loops=2)

  • Sort Key: t.a, t.d
  • Sort Method: quicksort Memory: 1706kB
  • Worker 0: Sort Method: quicksort Memory: 1706kB
12. 9.820 9.820 ↑ 1.0 20,000 2 / 2

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

13. 57.592 67.205 ↓ 7.7 153,452 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=29.452..67.205 rows=153,452 loops=2)

  • Sort Key: u.a, u.d
  • Sort Method: quicksort Memory: 1706kB
  • Worker 0: Sort Method: quicksort Memory: 1706kB
14. 9.613 9.613 ↑ 1.0 20,000 2 / 2

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

15. 10.342 458.713 ↑ 3.0 65,864 2 / 2

Materialize (cost=24,111.14..25,111.14 rows=200,000 width=12) (actual time=426.615..458.713 rows=65,864 loops=2)

16. 372.645 448.371 ↑ 5.0 40,053 2 / 2

Sort (cost=24,111.14..24,611.14 rows=200,000 width=12) (actual time=426.605..448.371 rows=40,053 loops=2)

  • Sort Key: s.b, s.c, s.d
  • Sort Method: external merge Disk: 4320kB
  • Worker 0: Sort Method: external merge Disk: 4320kB
17. 75.726 75.726 ↑ 1.0 200,000 2 / 2

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

Planning time : 19.116 ms
Execution time : 3,816.367 ms