explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ijKQ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 48,359.534 1,103,338.267 ↑ 2.3 8,304,862 1

GroupAggregate (cost=8,180,059.05..11,203,174.1 rows=18,877,282 width=116) (actual time=923,243.708..1,103,338.267 rows=8,304,862 loops=1)

  • Group Key: p.account_id, p.metadata_id, cr.country, (COALESCE(cr.alpha2_code, 'Unknown'::bpchar))
2. 47,523.005 1,054,978.733 ↓ 1.1 17,909,849 1

Gather Merge (cost=8,180,059.05..10,290,772.15 rows=15,731,068 width=156) (actual time=923,236.594..1,054,978.733 rows=17,909,849 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 37,067.462 1,007,455.728 ↑ 1.3 5,969,950 3 / 3

GroupAggregate (cost=8,179,059.02..8,474,016.55 rows=7,865,534 width=156) (actual time=920,890.753..1,007,455.728 rows=5,969,950 loops=3)

  • Group Key: p.account_id, p.metadata_id, cr.country, (COALESCE(cr.alpha2_code, 'Unknown'::bpchar))
4. 500,127.160 970,388.266 ↓ 4.2 32,781,150 3 / 3

Sort (cost=8,179,059.02..8,198,722.86 rows=7,865,534 width=72) (actual time=920,850.096..970,388.266 rows=32,781,150 loops=3)

  • Sort Key: p.account_id, p.metadata_id, cr.country, (COALESCE(cr.alpha2_code, 'Unknown'::bpchar))
  • Sort Method: external merge Disk: 1,731,032kB
5. 35,784.978 470,261.106 ↓ 4.2 32,781,150 3 / 3

Hash Join (cost=3,692.07..6,632,950.63 rows=7,865,534 width=72) (actual time=135.63..470,261.106 rows=32,781,150 loops=3)

6. 116,626.656 434,475.694 ↓ 4.2 32,781,150 3 / 3

Hash Join (cost=3,684.4..6,524,791.87 rows=7,865,534 width=31) (actual time=135.15..434,475.694 rows=32,781,150 loops=3)

7. 317,714.666 317,714.666 ↑ 1.2 56,660,801 3 / 3

Seq Scan on performance p (cost=0..3,910,127.07 rows=70,789,807 width=35) (actual time=0.196..317,714.666 rows=56,660,801 loops=3)

8. 70.554 134.372 ↑ 1.0 103,129 3 / 3

Hash (cost=1,790.29..1,790.29 rows=103,129 width=19) (actual time=134.372..134.372 rows=103,129 loops=3)

9. 63.818 63.818 ↑ 1.0 103,129 3 / 3

Seq Scan on brad_metadata_month_count m (cost=0..1,790.29 rows=103,129 width=19) (actual time=0.313..63.818 rows=103,129 loops=3)

10. 0.114 0.434 ↑ 1.0 252 3 / 3

Hash (cost=4.52..4.52 rows=252 width=15) (actual time=0.434..0.434 rows=252 loops=3)

11. 0.320 0.320 ↑ 1.0 252 3 / 3

Seq Scan on ext_country_region cr (cost=0..4.52 rows=252 width=15) (actual time=0.227..0.32 rows=252 loops=3)

Planning time : 1.064 ms
Execution time : 1,106,966.512 ms