explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5NrC : semi join

Settings
# exclusive inclusive rows x rows loops node
1. 282.546 13,562.271 ↓ 17.9 55,786 1

Unique (cost=92,164.90..92,180.50 rows=3,120 width=32) (actual time=12,849.176..13,562.271 rows=55,786 loops=1)

2. 3,248.451 13,279.725 ↓ 49.3 153,685 1

Sort (cost=92,164.90..92,172.70 rows=3,120 width=32) (actual time=12,849.143..13,279.725 rows=153,685 loops=1)

  • Sort Key: (ROW(u.a, u.b, t.c, u.d))
  • Sort Method: external merge Disk: 7080kB
3. 398.956 10,031.274 ↓ 49.3 153,685 1

Merge Join (cost=91,670.58..91,983.83 rows=3,120 width=32) (actual time=9,098.460..10,031.274 rows=153,685 loops=1)

  • Merge Cond: ((r.b = u.b) AND (t.a = u.a) AND (t.d = u.d))
4. 4,447.036 9,519.807 ↓ 19.8 395,952 1

Sort (cost=89,932.81..89,982.81 rows=20,000 width=24) (actual time=9,036.533..9,519.807 rows=395,952 loops=1)

  • Sort Key: r.b, t.a, t.d
  • Sort Method: external merge Disk: 33024kB
5. 1,211.914 5,072.771 ↓ 49.6 991,906 1

Hash Join (cost=84,123.95..88,504.04 rows=20,000 width=24) (actual time=3,835.633..5,072.771 rows=991,906 loops=1)

  • Hash Cond: ((t.a = r.a) AND (t.c = r.c))
6. 25.809 25.809 ↑ 1.0 20,000 1

Seq Scan on t (cost=0.00..309.00 rows=20,000 width=12) (actual time=0.035..25.809 rows=20,000 loops=1)

7. 128.038 3,835.048 ↓ 2.6 128,339 1

Hash (cost=83,373.95..83,373.95 rows=50,000 width=20) (actual time=3,835.047..3,835.048 rows=128,339 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 4 (originally 1) Memory Usage: 3329kB
8. 396.655 3,707.010 ↓ 2.6 128,339 1

Unique (cost=78,373.95..83,373.95 rows=50,000 width=20) (actual time=2,686.981..3,707.010 rows=128,339 loops=1)

9. 1,968.931 3,310.355 ↑ 1.0 500,000 1

Sort (cost=78,373.95..79,623.95 rows=500,000 width=20) (actual time=2,686.978..3,310.355 rows=500,000 loops=1)

  • Sort Key: r.a, r.b, r.c
  • Sort Method: external merge Disk: 14680kB
10. 707.668 1,341.424 ↑ 1.0 500,000 1

Hash Join (cost=4,337.03..20,790.03 rows=500,000 width=20) (actual time=429.233..1,341.424 rows=500,000 loops=1)

  • Hash Cond: ((r.b = s.b) AND (r.c = s.c))
11. 204.681 204.681 ↑ 1.0 500,000 1

Seq Scan on r (cost=0.00..7,703.00 rows=500,000 width=12) (actual time=0.029..204.681 rows=500,000 loops=1)

12. 11.254 429.075 ↑ 1.0 10,200 1

Hash (cost=4,184.01..4,184.01 rows=10,201 width=8) (actual time=429.074..429.075 rows=10,200 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 527kB
13. 209.468 417.821 ↑ 1.0 10,200 1

HashAggregate (cost=4,082.00..4,184.01 rows=10,201 width=8) (actual time=414.407..417.821 rows=10,200 loops=1)

  • Group Key: s.b, s.c
14. 208.353 208.353 ↑ 1.0 200,000 1

Seq Scan on s (cost=0.00..3,082.00 rows=200,000 width=8) (actual time=0.027..208.353 rows=200,000 loops=1)

15. 107.975 112.511 ↓ 7.7 153,768 1

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=61.781..112.511 rows=153,768 loops=1)

  • Sort Key: u.b, u.a, u.d
  • Sort Method: quicksort Memory: 1706kB
16. 4.536 4.536 ↑ 1.0 20,000 1

Seq Scan on u (cost=0.00..309.00 rows=20,000 width=12) (actual time=0.113..4.536 rows=20,000 loops=1)

Planning time : 1.923 ms
Execution time : 13,601.536 ms