explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j4IW

Settings
# exclusive inclusive rows x rows loops node
1. 13.566 78,184.937 ↑ 494.0 2 1

GroupAggregate (cost=2.11..199,397.75 rows=988 width=12) (actual time=3.631..78,184.937 rows=2 loops=1)

  • Group Key: campaign_contact.campaign_id
  • Filter: (count(*) < 2)
  • Rows Removed by Filter: 131
2. 27.819 78,171.371 ↓ 84.2 83,151 1

Nested Loop Anti Join (cost=2.11..199,380.46 rows=988 width=4) (actual time=0.494..78,171.371 rows=83,151 loops=1)

3. 59.021 77,977.134 ↓ 84.2 83,209 1

Nested Loop Semi Join (cost=1.54..198,620.27 rows=988 width=8) (actual time=0.484..77,977.134 rows=83,209 loops=1)

4. 11.932 77,582.341 ↓ 21.8 83,943 1

Nested Loop (cost=0.84..195,125.99 rows=3,843 width=12) (actual time=0.473..77,582.341 rows=83,943 loops=1)

5. 1.899 1.899 ↑ 1.3 155 1

Index Scan using campaign_pkey on campaign (cost=0.28..392.85 rows=197 width=4) (actual time=0.056..1.899 rows=155 loops=1)

  • Filter: (NOT is_archived)
  • Rows Removed by Filter: 3483
6. 77,568.510 77,568.510 ↓ 15.5 542 155

Index Scan using todos_partial_idx on campaign_contact (cost=0.56..988.14 rows=35 width=12) (actual time=1.292..500.442 rows=542 loops=155)

  • Index Cond: ((campaign_id = campaign.id) AND (message_status = 'needsResponse'::text))
7. 84.677 335.772 ↑ 1.0 1 83,943

Nested Loop (cost=0.70..0.90 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=83,943)

8. 167.886 167.886 ↑ 1.0 1 83,943

Index Scan using assignment_pkey on assignment (cost=0.42..0.60 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=83,943)

  • Index Cond: (id = campaign_contact.assignment_id)
9. 83.209 83.209 ↑ 1.0 1 83,209

Index Scan using campaign_pkey on campaign campaign_1 (cost=0.28..0.30 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=83,209)

  • Index Cond: (id = assignment.campaign_id)
  • Filter: (NOT is_archived)
10. 0.000 166.418 ↓ 0.0 0 83,209

Nested Loop (cost=0.56..0.76 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=83,209)

11. 166.418 166.418 ↓ 0.0 0 83,209

Index Only Scan using campaign_contact_tag_pkey on campaign_contact_tag (cost=0.42..0.58 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=83,209)

  • Index Cond: (campaign_contact_id = campaign_contact.id)
  • Heap Fetches: 588
12. 1.680 1.680 ↓ 0.0 0 840

Index Scan using tag_pkey on all_tag (cost=0.14..0.16 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=840)

  • Index Cond: (id = campaign_contact_tag.tag_id)
  • Filter: ((deleted_at IS NULL) AND (NOT is_assignable))
  • Rows Removed by Filter: 1
Planning time : 1.115 ms
Execution time : 78,185.263 ms