explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6mgl

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 11,682.558 ↑ 31,898.3 68 1

Finalize GroupAggregate (cost=3,568,819.40..3,837,559.83 rows=2,169,087 width=60) (actual time=11,402.874..11,682.558 rows=68 loops=1)

  • Group Key: campaign_contact.campaign_id, campaign.title
2. 104.660 11,685.492 ↑ 12,640.4 143 1

Gather Merge (cost=3,568,819.40..3,797,793.24 rows=1,807,572 width=60) (actual time=11,402.867..11,685.492 rows=143 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 94.462 11,580.832 ↑ 18,828.9 48 3 / 3

Partial GroupAggregate (cost=3,567,819.38..3,588,154.56 rows=903,786 width=60) (actual time=11,397.238..11,580.832 rows=48 loops=3)

  • Group Key: campaign_contact.campaign_id, campaign.title
4. 255.019 11,486.370 ↑ 1.6 579,942 3 / 3

Sort (cost=3,567,819.38..3,570,078.84 rows=903,786 width=48) (actual time=11,397.201..11,486.370 rows=579,942 loops=3)

  • Sort Key: campaign_contact.campaign_id, campaign.title
  • Sort Method: external merge Disk: 21680kB
5. 92.253 11,231.351 ↑ 1.6 579,942 3 / 3

Hash Join (cost=50,054.07..3,422,801.54 rows=903,786 width=48) (actual time=206.994..11,231.351 rows=579,942 loops=3)

  • Hash Cond: (campaign_contact.campaign_id = campaign.id)
6. 11,073.915 11,137.789 ↑ 1.5 594,727 3 / 3

Parallel Bitmap Heap Scan on campaign_contact (cost=49,865.55..3,420,222.21 rows=909,730 width=8) (actual time=205.653..11,137.789 rows=594,727 loops=3)

  • Recheck Cond: ((message_status = 'needsMessage'::text) AND (NOT archived))
  • Rows Removed by Index Recheck: 2783352
  • Heap Blocks: exact=11906 lossy=112838
7. 63.874 63.874 ↓ 1.4 3,017,886 1 / 3

Bitmap Index Scan on temp_partial_message_status_idx (cost=0.00..49,319.71 rows=2,183,353 width=0) (actual time=191.623..191.623 rows=3,017,886 loops=1)

  • Index Cond: (message_status = 'needsMessage'::text)
8. 0.580 1.309 ↓ 1.0 3,652 3 / 3

Hash (cost=142.91..142.91 rows=3,649 width=44) (actual time=1.309..1.309 rows=3,652 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 312kB
9. 0.729 0.729 ↓ 1.0 3,652 3 / 3

Seq Scan on campaign (cost=0.00..142.91 rows=3,649 width=44) (actual time=0.005..0.729 rows=3,652 loops=3)

  • Filter: (organization_id = 1)
  • Rows Removed by Filter: 24
Planning time : 1.339 ms
Execution time : 11,688.735 ms