explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0Pn9

Settings
# exclusive inclusive rows x rows loops node
1. 1.080 285.473 ↓ 0.0 0 1

Delete on campaign_contact (cost=320,400.39..332,830.08 rows=1,107 width=24) (actual time=285.473..285.473 rows=0 loops=1)

2. 0.313 284.393 ↑ 2.8 397 1

Nested Loop Anti Join (cost=320,400.39..332,830.08 rows=1,107 width=24) (actual time=281.860..284.393 rows=397 loops=1)

3. 0.170 283.683 ↑ 3.3 397 1

Nested Loop (cost=320,399.82..331,487.36 rows=1,307 width=22) (actual time=281.849..283.683 rows=397 loops=1)

4. 0.244 281.925 ↑ 3.3 397 1

HashAggregate (cost=320,399.25..320,412.32 rows=1,307 width=16) (actual time=281.829..281.925 rows=397 loops=1)

  • Group Key: campaign_contact_1.id
5. 53.180 281.681 ↑ 3.3 397 1

Hash Join (cost=107,577.16..320,395.99 rows=1,307 width=16) (actual time=191.495..281.681 rows=397 loops=1)

  • Hash Cond: (other_contact.cell = campaign_contact_1.cell)
6. 86.387 86.387 ↑ 1.5 67,380 1

Index Scan using campaign_contact_campaign_id_index on campaign_contact other_contact (cost=0.57..212,552.91 rows=101,520 width=18) (actual time=0.056..86.387 rows=67,380 loops=1)

  • Index Cond: (campaign_id = ANY ('{4935,4864}'::integer[]))
7. 61.154 142.114 ↓ 5.9 299,992 1

Hash (cost=106,942.09..106,942.09 rows=50,760 width=22) (actual time=142.114..142.114 rows=299,992 loops=1)

  • Buckets: 65536 (originally 65536) Batches: 8 (originally 1) Memory Usage: 3585kB
8. 80.960 80.960 ↓ 5.9 299,992 1

Index Scan using campaign_contact_campaign_id_index on campaign_contact campaign_contact_1 (cost=0.57..106,942.09 rows=50,760 width=22) (actual time=0.015..80.960 rows=299,992 loops=1)

  • Index Cond: (campaign_id = 4966)
9. 1.588 1.588 ↑ 1.0 1 397

Index Scan using campaign_contact_pkey on campaign_contact (cost=0.57..8.47 rows=1 width=10) (actual time=0.004..0.004 rows=1 loops=397)

  • Index Cond: (id = campaign_contact_1.id)
10. 0.397 0.397 ↓ 0.0 0 397

Index Scan using message_campaign_contact_id_index on message (cost=0.57..3.85 rows=8 width=10) (actual time=0.001..0.001 rows=0 loops=397)

  • Index Cond: (campaign_contact_id = campaign_contact.id)
Planning time : 0.686 ms
Execution time : 305.497 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint question_response_campaign_contact_id_foreign 7.030 ms 397 0.018 ms
for constraint message_campaign_contact_id_foreign 6.439 ms 397 0.016 ms
for constraint campaign_contact_tag_campaign_contact_id_foreign 6.207 ms 397 0.016 ms