explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RYPh : Default

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

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

2. 797.869 2,112.709 ↓ 2.0 118,401 1

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

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

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

  • Workers Planned: 1
  • Workers Launched: 1
4. 89.476 1,244.194 ↓ 1.7 59,200 2 / 2

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

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

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

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

7. 36.186 729.445 ↓ 4.3 63,842 2 / 2

Sort (cost=50,496.78..50,533.95 rows=14,866 width=28) (actual time=720.757..729.445 rows=63,842 loops=2)

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

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

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

Sort (cost=22,975.55..23,366.52 rows=156,390 width=24) (actual time=308.570..362.323 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. 66.237 122.414 ↓ 1.0 158,676 2 / 2

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

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

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=19.625..21.204 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.352 5.352 ↑ 1.0 20,000 2 / 2

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

13. 29.199 34.973 ↓ 7.9 158,667 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=17.323..34.973 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.774 5.774 ↑ 1.0 20,000 2 / 2

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

15. 10.432 269.672 ↑ 3.0 66,388 2 / 2

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

16. 222.898 259.240 ↑ 5.0 39,885 2 / 2

Sort (cost=24,111.14..24,611.14 rows=200,000 width=12) (actual time=245.285..259.240 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.342 36.342 ↑ 1.0 200,000 2 / 2

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

Planning time : 5.326 ms
Execution time : 2,202.770 ms