explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TYNB

Settings
# exclusive inclusive rows x rows loops node
1. 1.028 166.804 ↓ 0.0 0 1

Delete on campaign_contact (cost=214,654.70..220,873.60 rows=554 width=24) (actual time=166.804..166.804 rows=0 loops=1)

2. 0.001 165.776 ↑ 1.6 351 1

Nested Loop Anti Join (cost=214,654.70..220,873.60 rows=554 width=24) (actual time=163.352..165.776 rows=351 loops=1)

3. 0.255 165.073 ↑ 1.9 351 1

Nested Loop (cost=214,654.13..220,201.80 rows=654 width=22) (actual time=163.339..165.073 rows=351 loops=1)

4. 0.263 163.414 ↑ 1.9 351 1

HashAggregate (cost=214,653.56..214,660.10 rows=654 width=16) (actual time=163.320..163.414 rows=351 loops=1)

  • Group Key: campaign_contact_1.id
5. 48.590 163.151 ↑ 1.9 351 1

Hash Join (cost=107,577.16..214,651.93 rows=654 width=16) (actual time=23.892..163.151 rows=351 loops=1)

  • Hash Cond: (campaign_contact_1.cell = other_contact.cell)
6. 92.002 92.002 ↓ 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..92.002 rows=299,992 loops=1)

  • Index Cond: (campaign_id = 4,966)
7. 6.670 22.559 ↑ 1.6 31,192 1

Hash (cost=106,942.09..106,942.09 rows=50,760 width=18) (actual time=22.559..22.559 rows=31,192 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,066kB
8. 15.889 15.889 ↑ 1.6 31,192 1

Index Scan using campaign_contact_campaign_id_index on campaign_contact other_contact (cost=0.57..106,942.09 rows=50,760 width=18) (actual time=0.021..15.889 rows=31,192 loops=1)

  • Index Cond: (campaign_id = 4,935)
9. 1.404 1.404 ↑ 1.0 1 351

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=351)

  • Index Cond: (id = campaign_contact_1.id)
10. 0.702 0.702 ↓ 0.0 0 351

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=351)

  • Index Cond: (campaign_contact_id = campaign_contact.id)
Planning time : 0.589 ms
Execution time : 193.983 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint question_response_campaign_contact_id_foreign 9.551 ms 351 0.027 ms
for constraint message_campaign_contact_id_foreign 8.704 ms 351 0.025 ms
for constraint campaign_contact_tag_campaign_contact_id_foreign 8.510 ms 351 0.024 ms