explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VdHT

Settings
# exclusive inclusive rows x rows loops node
1. 29,526.312 147,121.213 ↑ 12.9 24,465,584 1

GroupAggregate (cost=77,309,572.80..83,604,037.74 rows=314,723,247 width=24) (actual time=104,143.067..147,121.213 rows=24,465,584 loops=1)

  • Group Key: r1.person, r2.person
2. 80,425.591 117,594.901 ↑ 7.0 44,998,742 1

Sort (cost=77,309,572.80..78,096,380.92 rows=314,723,247 width=24) (actual time=104,143.028..117,594.901 rows=44,998,742 loops=1)

  • Sort Key: r1.person, r2.person
  • Sort Method: external merge Disk: 1495640kB
3. 13,957.616 37,169.310 ↑ 7.0 44,998,742 1

Merge Join (cost=0.87..7,070,011.91 rows=314,723,247 width=24) (actual time=0.040..37,169.310 rows=44,998,742 loops=1)

  • Merge Cond: (r1.paper = r2.paper)
  • Join Filter: (r1.person <> r2.person)
  • Rows Removed by Join Filter: 16729599
4. 2,464.125 2,464.125 ↑ 1.0 16,729,599 1

Index Scan using role_paper_idx on role r1 (cost=0.43..760,253.92 rows=16,729,599 width=16) (actual time=0.017..2,464.125 rows=16,729,599 loops=1)

5. 4,150.320 20,747.569 ↓ 3.7 61,728,341 1

Materialize (cost=0.43..802,077.92 rows=16,729,599 width=16) (actual time=0.012..20,747.569 rows=61,728,341 loops=1)

6. 16,597.249 16,597.249 ↑ 1.0 16,729,599 1

Index Scan using role_paper_idx on role r2 (cost=0.43..760,253.92 rows=16,729,599 width=16) (actual time=0.008..16,597.249 rows=16,729,599 loops=1)

Planning time : 0.543 ms
Execution time : 157,180.211 ms