explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CQZD

Settings
# exclusive inclusive rows x rows loops node
1. 1.531 450.571 ↓ 0.0 0 1

Delete on campaign_contact (cost=424,843.11..443,492.95 rows=1,661 width=24) (actual time=450.571..450.571 rows=0 loops=1)

2. 0.249 449.040 ↑ 4.1 402 1

Nested Loop Anti Join (cost=424,843.11..443,492.95 rows=1,661 width=24) (actual time=445.588..449.040 rows=402 loops=1)

3. 0.278 447.987 ↑ 4.9 402 1

Nested Loop (cost=424,842.54..441,478.37 rows=1,961 width=22) (actual time=445.577..447.987 rows=402 loops=1)

4. 0.326 445.699 ↑ 4.9 402 1

HashAggregate (cost=424,841.97..424,861.58 rows=1,961 width=16) (actual time=445.558..445.699 rows=402 loops=1)

  • Group Key: campaign_contact_1.id
5. 78.439 445.373 ↑ 4.9 402 1

Hash Join (cost=107,577.16..424,837.07 rows=1,961 width=16) (actual time=331.520..445.373 rows=402 loops=1)

  • Hash Cond: (other_contact.cell = campaign_contact_1.cell)
6. 224.549 224.549 ↑ 1.8 84,120 1

Index Scan using campaign_contact_campaign_id_index on campaign_contact other_contact (cost=0.57..316,860.74 rows=152,280 width=18) (actual time=0.034..224.549 rows=84,120 loops=1)

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

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

  • Buckets: 65,536 (originally 65536) Batches: 8 (originally 1) Memory Usage: 3,585kB
8. 81.640 81.640 ↓ 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.014..81.640 rows=299,992 loops=1)

  • Index Cond: (campaign_id = 4,966)
9. 2.010 2.010 ↑ 1.0 1 402

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

  • Index Cond: (id = campaign_contact_1.id)
10. 0.804 0.804 ↓ 0.0 0 402

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

  • Index Cond: (campaign_contact_id = campaign_contact.id)
Planning time : 0.601 ms
Execution time : 479.095 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint question_response_campaign_contact_id_foreign 9.881 ms 402 0.025 ms
for constraint message_campaign_contact_id_foreign 9.247 ms 402 0.023 ms
for constraint campaign_contact_tag_campaign_contact_id_foreign 8.977 ms 402 0.022 ms