explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ATsH

Settings
# exclusive inclusive rows x rows loops node
1. 82.750 2,209.810 ↑ 6.0 9,772 1

Unique (cost=102,564.22..102,859.27 rows=59,011 width=32) (actual time=1,992.564..2,209.810 rows=9,772 loops=1)

2. 812.982 2,127.060 ↓ 2.0 118,401 1

Sort (cost=102,564.22..102,711.74 rows=59,011 width=32) (actual time=1,992.562..2,127.060 rows=118,401 loops=1)

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

Gather (cost=88,885.26..97,887.98 rows=59,011 width=32) (actual time=1,073.571..1,314.078 rows=118,401 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 87.093 1,249.031 ↓ 1.7 59,200 2 / 2

Merge Join (cost=87,885.26..90,986.88 rows=34,712 width=32) (actual time=1,053.909..1,249.031 rows=59,200 loops=2)

  • Merge Cond: ((r.c = s.c) AND (r.b = s.b) AND (r.a = t.a))
5. 383.472 435.597 ↑ 1.2 248,460 2 / 2

Sort (cost=37,388.47..38,123.76 rows=294,118 width=12) (actual time=336.058..435.597 rows=248,460 loops=2)

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

7. 36.093 726.341 ↓ 4.3 63,606 2 / 2

Sort (cost=50,496.78..50,533.95 rows=14,866 width=28) (actual time=717.745..726.341 rows=63,606 loops=2)

  • Sort Key: s.c, s.b, t.a
  • Sort Method: quicksort Memory: 3142kB
  • Worker 0: Sort Method: quicksort Memory: 3142kB
8. 61.339 690.248 ↓ 2.0 30,377 2 / 2

Merge Join (cost=47,086.88..49,466.59 rows=14,866 width=28) (actual time=550.965..690.248 rows=30,377 loops=2)

  • Merge Cond: ((u.b = s.b) AND (t.c = s.c) AND (t.d = s.d))
9. 238.612 361.457 ↓ 1.0 158,676 2 / 2

Sort (cost=22,975.55..23,366.52 rows=156,390 width=24) (actual time=307.503..361.457 rows=158,676 loops=2)

  • Sort Key: u.b, t.c, t.d
  • Sort Method: external merge Disk: 5288kB
  • Worker 0: Sort Method: external merge Disk: 5288kB
10. 67.168 122.845 ↓ 1.0 158,676 2 / 2

Merge Join (cost=3,475.54..6,273.66 rows=156,390 width=24) (actual time=36.659..122.845 rows=158,676 loops=2)

  • Merge Cond: ((t.a = u.a) AND (t.d = u.d))
11. 15.723 21.118 ↑ 2.5 7,940 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=19.577..21.118 rows=7,940 loops=2)

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

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

13. 28.949 34.559 ↓ 7.9 158,667 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=17.071..34.559 rows=158,667 loops=2)

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

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

15. 10.396 267.452 ↑ 3.0 66,388 2 / 2

Materialize (cost=24,111.14..25,111.14 rows=200,000 width=12) (actual time=243.397..267.452 rows=66,388 loops=2)

16. 220.465 257.056 ↑ 5.0 39,885 2 / 2

Sort (cost=24,111.14..24,611.14 rows=200,000 width=12) (actual time=243.390..257.056 rows=39,885 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. 36.591 36.591 ↑ 1.0 200,000 2 / 2

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

Planning time : 5.089 ms
Execution time : 2,218.576 ms