explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NrOY

Settings
# exclusive inclusive rows x rows loops node
1. 80.104 2,137.067 ↑ 6.1 9,867 1

Unique (cost=103,020.66..103,321.19 rows=60,106 width=32) (actual time=1,927.709..2,137.067 rows=9,867 loops=1)

2. 822.495 2,056.963 ↓ 2.0 118,232 1

Sort (cost=103,020.66..103,170.93 rows=60,106 width=32) (actual time=1,927.707..2,056.963 rows=118,232 loops=1)

  • Sort Key: (ROW(r.a, r.b, r.c, s.d))
  • Sort Method: external merge Disk: 5448kB
3. 71.414 1,234.468 ↓ 2.0 118,232 1

Gather (cost=89,133.10..98,249.68 rows=60,106 width=32) (actual time=1,072.346..1,234.468 rows=118,232 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 65.741 1,163.054 ↓ 1.7 59,116 2 / 2

Merge Join (cost=88,133.10..91,239.08 rows=35,356 width=32) (actual time=1,047.185..1,163.054 rows=59,116 loops=2)

  • Merge Cond: ((r.b = s.b) AND (r.c = s.c) AND (r.a = t.a))
5. 319.592 373.057 ↑ 2.9 102,460 2 / 2

Sort (cost=37,388.47..38,123.76 rows=294,118 width=12) (actual time=331.339..373.057 rows=102,460 loops=2)

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

7. 36.180 724.256 ↓ 4.2 63,646 2 / 2

Sort (cost=50,744.63..50,782.54 rows=15,167 width=28) (actual time=715.807..724.256 rows=63,646 loops=2)

  • Sort Key: s.b, s.c, t.a
  • Sort Method: quicksort Memory: 3156kB
  • Worker 0: Sort Method: quicksort Memory: 3156kB
8. 60.758 688.076 ↓ 2.0 30,560 2 / 2

Merge Join (cost=47,292.29..49,691.38 rows=15,167 width=28) (actual time=548.340..688.076 rows=30,560 loops=2)

  • Merge Cond: ((u.b = s.b) AND (t.c = s.c) AND (t.d = s.d))
9. 238.935 358.509 ↓ 1.0 159,559 2 / 2

Sort (cost=23,180.96..23,575.85 rows=157,956 width=24) (actual time=304.243..358.509 rows=159,559 loops=2)

  • Sort Key: u.b, t.c, t.d
  • Sort Method: external merge Disk: 5320kB
  • Worker 0: Sort Method: external merge Disk: 5320kB
10. 63.788 119.574 ↓ 1.0 159,559 2 / 2

Merge Join (cost=3,475.54..6,301.12 rows=157,956 width=24) (actual time=36.572..119.574 rows=159,559 loops=2)

  • Merge Cond: ((t.a = u.a) AND (t.d = u.d))
11. 15.680 21.104 ↑ 2.5 7,945 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=19.550..21.104 rows=7,945 loops=2)

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

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

13. 29.283 34.682 ↓ 8.0 159,551 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=17.012..34.682 rows=159,551 loops=2)

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

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

15. 10.870 268.809 ↑ 3.0 66,555 2 / 2

Materialize (cost=24,111.14..25,111.14 rows=200,000 width=12) (actual time=244.077..268.809 rows=66,555 loops=2)

16. 221.448 257.939 ↑ 5.0 39,901 2 / 2

Sort (cost=24,111.14..24,611.14 rows=200,000 width=12) (actual time=244.071..257.939 rows=39,901 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.491 36.491 ↑ 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.491 rows=200,000 loops=2)