explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NN1B : btree

Settings
# exclusive inclusive rows x rows loops node
1. 177.206 4,282.750 ↑ 6.1 9,523 1

Unique (cost=102,208.02..102,497.94 rows=57,984 width=32) (actual time=3,842.122..4,282.750 rows=9,523 loops=1)

2. 1,539.587 4,105.544 ↓ 2.0 117,145 1

Sort (cost=102,208.02..102,352.98 rows=57,984 width=32) (actual time=3,842.121..4,105.544 rows=117,145 loops=1)

  • Sort Key: (ROW(r.a, r.b, r.c, s.d))
  • Sort Method: external merge Disk: 5400kB
3. 260.560 2,565.957 ↓ 2.0 117,145 1

Gather (cost=88,718.33..97,620.51 rows=57,984 width=32) (actual time=2,019.575..2,565.957 rows=117,145 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 157.130 2,305.397 ↓ 1.7 58,572 2 / 2

Merge Join (cost=87,718.33..90,822.11 rows=34,108 width=32) (actual time=1,968.258..2,305.397 rows=58,572 loops=2)

  • Merge Cond: ((r.c = s.c) AND (r.b = s.b) AND (r.a = t.a))
5. 657.812 753.690 ↑ 1.2 248,516 2 / 2

Sort (cost=37,388.47..38,123.76 rows=294,118 width=12) (actual time=592.090..753.690 rows=248,516 loops=2)

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

7. 101.032 1,394.577 ↓ 4.2 63,794 2 / 2

Sort (cost=50,329.86..50,367.54 rows=15,071 width=28) (actual time=1,376.116..1,394.577 rows=63,794 loops=2)

  • Sort Key: s.c, s.b, t.a
  • Sort Method: quicksort Memory: 3106kB
  • Worker 0: Sort Method: quicksort Memory: 3106kB
8. 84.812 1,293.545 ↓ 2.0 29,914 2 / 2

Merge Join (cost=46,917.99..49,283.98 rows=15,071 width=28) (actual time=1,054.072..1,293.545 rows=29,914 loops=2)

  • Merge Cond: ((u.b = s.b) AND (t.c = s.c) AND (t.d = s.d))
9. 450.688 666.868 ↑ 1.0 154,134 2 / 2

Sort (cost=22,806.85..23,194.66 rows=155,125 width=24) (actual time=554.404..666.868 rows=154,134 loops=2)

  • Sort Key: u.b, t.c, t.d
  • Sort Method: external merge Disk: 5136kB
  • Worker 0: Sort Method: external merge Disk: 5136kB
10. 110.843 216.180 ↑ 1.0 154,134 2 / 2

Merge Join (cost=3,475.54..6,251.19 rows=155,125 width=24) (actual time=62.224..216.180 rows=154,134 loops=2)

  • Merge Cond: ((t.d = u.d) AND (t.a = u.a))
11. 28.212 33.823 ↑ 2.5 7,896 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=32.119..33.823 rows=7,896 loops=2)

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

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

13. 65.645 71.514 ↓ 7.7 154,180 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=30.087..71.514 rows=154,180 loops=2)

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

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

15. 14.480 541.865 ↑ 3.0 65,859 2 / 2

Materialize (cost=24,111.14..25,111.14 rows=200,000 width=12) (actual time=499.621..541.865 rows=65,859 loops=2)

16. 456.422 527.385 ↑ 5.0 39,873 2 / 2

Sort (cost=24,111.14..24,611.14 rows=200,000 width=12) (actual time=499.614..527.385 rows=39,873 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. 70.963 70.963 ↑ 1.0 200,000 2 / 2

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

Planning time : 4.025 ms
Execution time : 4,291.105 ms