explain.depesz.com

PostgreSQL's explain analyze made readable

Result: allY

Settings
# exclusive inclusive rows x rows loops node
1. 12.913 83,417.943 ↑ 15.1 134 1

GroupAggregate (cost=1.41..198,121.65 rows=2,028 width=12) (actual time=2.959..83,417.943 rows=134 loops=1)

  • Group Key: campaign_contact.campaign_id
2. 46.643 83,405.030 ↓ 21.7 83,301 1

Nested Loop Anti Join (cost=1.41..198,082.16 rows=3,842 width=4) (actual time=0.662..83,405.030 rows=83,301 loops=1)

3. 11.275 83,190.747 ↓ 21.8 83,820 1

Nested Loop (cost=0.84..195,125.99 rows=3,842 width=8) (actual time=0.651..83,190.747 rows=83,820 loops=1)

4. 2.132 2.132 ↑ 1.3 155 1

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

  • Filter: (NOT is_archived)
  • Rows Removed by Filter: 3483
5. 83,177.340 83,177.340 ↓ 15.5 541 155

Index Scan using todos_partial_idx on campaign_contact (cost=0.56..988.14 rows=35 width=8) (actual time=1.296..536.628 rows=541 loops=155)

  • Index Cond: ((campaign_id = campaign.id) AND (message_status = 'needsResponse'::text))
6. 0.000 167.640 ↓ 0.0 0 83,820

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

7. 167.640 167.640 ↓ 0.0 0 83,820

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,820)

  • Index Cond: (campaign_contact_id = campaign_contact.id)
  • Heap Fetches: 949
8. 2.684 2.684 ↓ 0.0 0 1,342

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=1,342)

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