explain.depesz.com

PostgreSQL's explain analyze made readable

Result: imgr

Settings
# exclusive inclusive rows x rows loops node
1. 294.356 16,264.518 ↓ 17.4 65,897 1

Unique (cost=98,945.73..98,964.65 rows=3,784 width=32) (actual time=15,276.848..16,264.518 rows=65,897 loops=1)

2. 3,937.932 15,970.162 ↓ 49.1 185,692 1

Sort (cost=98,945.73..98,955.19 rows=3,784 width=32) (actual time=15,276.845..15,970.162 rows=185,692 loops=1)

  • Sort Key: (ROW(u.a, u.b, s.c, u.d))
  • Sort Method: external merge Disk: 8560kB
3. 1,114.626 12,032.230 ↓ 49.1 185,692 1

Gather (cost=98,069.48..98,720.85 rows=3,784 width=32) (actual time=11,097.684..12,032.230 rows=185,692 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 208.413 10,917.604 ↓ 41.7 92,846 2 / 2

Merge Join (cost=97,069.48..97,342.45 rows=2,226 width=32) (actual time=10,532.644..10,917.604 rows=92,846 loops=2)

  • Merge Cond: ((s.d = u.d) AND (s.b = u.b) AND (r.a = u.a))
5. 4,485.544 10,640.784 ↓ 8.0 244,318 2 / 2

Sort (cost=95,331.68..95,407.85 rows=30,466 width=24) (actual time=10,471.922..10,640.784 rows=244,318 loops=2)

  • Sort Key: s.d, s.b, r.a
  • Sort Method: external merge Disk: 47016kB
  • Worker 0: Sort Method: external merge Disk: 36456kB
6. 1,704.782 6,155.240 ↓ 41.1 1,253,654 2 / 2

Hash Join (cost=84,123.95..93,062.74 rows=30,466 width=24) (actual time=4,416.484..6,155.240 rows=1,253,654 loops=2)

  • Hash Cond: ((s.b = r.b) AND (s.c = r.c))
7. 34.434 34.434 ↑ 1.2 100,000 2 / 2

Parallel Seq Scan on s (cost=0.00..2,258.47 rows=117,647 width=12) (actual time=0.028..34.434 rows=100,000 loops=2)

8. 176.201 4,416.024 ↓ 2.6 128,339 2 / 2

Hash (cost=83,373.95..83,373.95 rows=50,000 width=20) (actual time=4,416.024..4,416.024 rows=128,339 loops=2)

  • Buckets: 131072 (originally 65536) Batches: 4 (originally 1) Memory Usage: 3329kB
9. 377.671 4,239.823 ↓ 2.6 128,339 2 / 2

Unique (cost=78,373.95..83,373.95 rows=50,000 width=20) (actual time=3,120.448..4,239.823 rows=128,339 loops=2)

10. 2,402.198 3,862.152 ↑ 1.0 500,000 2 / 2

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

  • Sort Key: r.a, r.b, r.c
  • Sort Method: external merge Disk: 14680kB
  • Worker 0: Sort Method: external merge Disk: 14680kB
11. 773.598 1,459.954 ↑ 1.0 500,000 2 / 2

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

  • Hash Cond: ((r.b = s_1.b) AND (r.c = s_1.c))
12. 312.420 312.420 ↑ 1.0 500,000 2 / 2

Seq Scan on r (cost=0.00..7,703.00 rows=500,000 width=12) (actual time=0.035..312.420 rows=500,000 loops=2)

13. 27.039 373.936 ↑ 1.0 10,200 2 / 2

Hash (cost=4,184.01..4,184.01 rows=10,201 width=8) (actual time=373.936..373.936 rows=10,200 loops=2)

  • Buckets: 16384 Batches: 1 Memory Usage: 527kB
14. 198.359 346.897 ↑ 1.0 10,200 2 / 2

HashAggregate (cost=4,082.00..4,184.01 rows=10,201 width=8) (actual time=343.443..346.897 rows=10,200 loops=2)

  • Group Key: s_1.b, s_1.c
15. 148.538 148.538 ↑ 1.0 200,000 2 / 2

Seq Scan on s s_1 (cost=0.00..3,082.00 rows=200,000 width=8) (actual time=0.020..148.538 rows=200,000 loops=2)

16. 54.627 68.407 ↓ 4.7 93,052 2 / 2

Sort (cost=1,737.77..1,787.77 rows=20,000 width=12) (actual time=56.678..68.407 rows=93,052 loops=2)

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

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