explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F69b : select contact newsletter_id = 329506

Settings
# exclusive inclusive rows x rows loops node
1. 0.056 96,014.391 ↑ 1.0 1 1

Limit (cost=26.10..27.05 rows=1 width=57) (actual time=96,014.339..96,014.391 rows=1 loops=1)

2. 0.009 96,014.335 ↑ 954,305.0 1 1

Unique (cost=26.10..902,574.18 rows=954,305 width=57) (actual time=96,014.331..96,014.335 rows=1 loops=1)

3. 7,585.187 96,014.326 ↑ 954,305.0 1 1

Merge Left Join (cost=26.10..900,188.42 rows=954,305 width=57) (actual time=96,014.322..96,014.326 rows=1 loops=1)

  • Merge Cond: (contact_contact.id = contact_contactlist_contacts.contact_id)
  • Filter: ((communication_newsletter_recipients.newsletter_id = 329506) OR (hashed SubPlan 1))
  • Rows Removed by Filter: 2145248
4. 10,855.197 65,627.759 ↑ 1.0 1,859,191 1

Nested Loop Left Join (cost=0.72..798,609.01 rows=1,908,414 width=57) (actual time=0.066..65,627.759 rows=1,859,191 loops=1)

5. 47,371.134 47,371.134 ↑ 1.0 1,850,357 1

Index Scan using contact_contact_pkey on contact_contact (cost=0.43..144,293.21 rows=1,908,414 width=53) (actual time=0.027..47,371.134 rows=1,850,357 loops=1)

  • Filter: ((NOT inactive) AND ((source)::text <> 'I'::text))
  • Rows Removed by Filter: 550806
6. 7,401.428 7,401.428 ↓ 0.0 0 1,850,357

Index Scan using communication_newsletter_recipients_6d82f13d on communication_newsletter_recipients (cost=0.29..0.32 rows=2 width=8) (actual time=0.004..0.004 rows=0 loops=1,850,357)

  • Index Cond: (contact_contact.id = contact_id)
7. 22,801.231 22,801.231 ↓ 1.0 1,533,683 1

Index Scan using contact_contactlist_contacts_6d82f13d on contact_contactlist_contacts (cost=0.43..75,187.35 rows=1,532,568 width=8) (actual time=0.008..22,801.231 rows=1,533,683 loops=1)

8.          

SubPlan (for Merge Left Join)

9. 0.009 0.149 ↑ 2.0 1 1

Nested Loop (cost=0.57..24.95 rows=2 width=4) (actual time=0.137..0.149 rows=1 loops=1)

10. 0.106 0.106 ↑ 2.0 1 1

Index Scan using communication_newsletter_recipient_lists_5bf08b02 on communication_newsletter_recipient_lists u1 (cost=0.29..8.33 rows=2 width=4) (actual time=0.100..0.106 rows=1 loops=1)

  • Index Cond: (newsletter_id = 329506)
11. 0.034 0.034 ↑ 1.0 1 1

Index Only Scan using contact_contactlist_pkey on contact_contactlist u0 (cost=0.29..8.30 rows=1 width=4) (actual time=0.028..0.034 rows=1 loops=1)

  • Index Cond: (id = u1.contactlist_id)
  • Heap Fetches: 1
Planning time : 3.594 ms
Execution time : 96,014.650 ms