explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yOFJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 3,147.581 ↓ 7.9 63 1

Hash Left Join (cost=107,332.00..138,221.67 rows=8 width=206) (actual time=2,944.477..3,147.581 rows=63 loops=1)

  • Hash Cond: (se.scheduled_email_transmission_id = ""*VALUES*"".column1)
2. 0.041 3,147.456 ↓ 7.9 63 1

Nested Loop Left Join (cost=107,323.68..138,213.23 rows=8 width=202) (actual time=2,944.380..3,147.456 rows=63 loops=1)

3. 0.053 3,147.415 ↓ 7.9 63 1

Hash Left Join (cost=107,323.25..138,162.36 rows=8 width=207) (actual time=2,944.377..3,147.415 rows=63 loops=1)

  • Hash Cond: ((se.cid = stle.cid) AND (se.scheduled_task_log_id = stle.scheduled_task_log_id) AND (se.property_id = stle.property_id))
  • Join Filter: ((se.cid = 12,859) AND ((se.sent_on)::date >= '2019-12-30'::date) AND ((se.sent_on)::date <= '2020-01-05'::date) AND ((se.system_email_type_id = 102) OR ((se.system_email_type_id = 62) AND (se.scheduled_email_id IS NOT NULL))) AND (se.property_id = ANY ('{218060,218061,218062,218064,218065,218066,218067,218068,218070,218071,218099,218104,218105,252494,518395,536150,570963,843826,886853,908584}'::integer[])))
4. 0.060 3,147.297 ↓ 7.9 63 1

Nested Loop Left Join (cost=107,309.05..138,147.99 rows=8 width=183) (actual time=2,944.298..3,147.297 rows=63 loops=1)

5. 0.075 3,146.544 ↓ 7.9 63 1

Nested Loop Left Join (cost=107,308.48..138,110.81 rows=8 width=119) (actual time=2,944.268..3,146.544 rows=63 loops=1)

  • Filter: ((((se.applicant_id IS NOT NULL) OR (ser.id IS NOT NULL)) AND (se.customer_id IS NULL) AND (se.company_employee_id IS NULL)) OR ((ser.id IS NOT NULL) AND (ser.reference_number IS NOT NULL)))
  • Rows Removed by Filter: 71
6. 2,302.343 3,146.201 ↓ 16.8 134 1

Bitmap Heap Scan on system_emails se (cost=107,307.91..138,073.65 rows=8 width=88) (actual time=2,944.245..3,146.201 rows=134 loops=1)

  • Recheck Cond: ((property_id = ANY ('{218060,218061,218062,218064,218065,218066,218067,218068,218070,218071,218099,218104,218105,252494,518395,536150,570963,843826,886853,908584}'::integer[])) AND (cid = 12,859))
  • Filter: (((sent_on)::date >= '2019-12-30'::date) AND ((sent_on)::date <= '2020-01-05'::date) AND ((system_email_type_id = 102) OR ((system_email_type_id = 62) AND (scheduled_email_id IS NOT NULL))))
  • Rows Removed by Filter: 576,421
  • Heap Blocks: exact=368,674
7. 46.040 843.858 ↓ 0.0 0 1

BitmapAnd (cost=107,307.91..107,307.91 rows=15,109 width=0) (actual time=843.858..843.858 rows=0 loops=1)

8. 93.561 93.561 ↑ 1.5 576,808 1

Bitmap Index Scan on idx_system_emails_property_id (cost=0.00..12,232.25 rows=878,245 width=0) (actual time=93.560..93.561 rows=576,808 loops=1)

  • Index Cond: (property_id = ANY ('{218060,218061,218062,218064,218065,218066,218067,218068,218070,218071,218099,218104,218105,252494,518395,536150,570963,843826,886853,908584}'::integer[]))
9. 704.257 704.257 ↑ 2.1 3,234,219 1

Bitmap Index Scan on idx_system_emails_cid (cost=0.00..95,075.40 rows=6,839,311 width=0) (actual time=704.257..704.257 rows=3,234,219 loops=1)

  • Index Cond: (cid = 12,859)
10. 0.268 0.268 ↓ 0.0 0 134

Index Scan using idx_system_email_recipients_custom_system_email_id on system_email_recipients ser (cost=0.57..4.62 rows=1 width=39) (actual time=0.002..0.002 rows=0 loops=134)

  • Index Cond: ((cid = se.cid) AND (cid = 12,859) AND (recipient_type_id = 1) AND (system_email_id = se.id))
11. 0.693 0.693 ↑ 1.0 1 63

Index Scan using idx_email_events_system_email_id on email_events ee (cost=0.57..4.62 rows=1 width=72) (actual time=0.011..0.011 rows=1 loops=63)

  • Index Cond: (system_email_id = se.id)
  • Filter: ((cid = 12,859) AND (cid = se.cid))
12. 0.031 0.065 ↑ 1.0 160 1

Hash (cost=8.20..8.20 rows=160 width=44) (actual time=0.065..0.065 rows=160 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
13. 0.034 0.034 ↑ 1.0 160 1

Seq Scan on scheduled_task_logs_events stle (cost=0.00..8.20 rows=160 width=44) (actual time=0.008..0.034 rows=160 loops=1)

  • Filter: (cid = 12,859)
14. 0.000 0.000 ↓ 0.0 0 63

Index Scan using idx_system_email_blocks_email_address on system_email_blocks seb (cost=0.43..6.33 rows=1 width=26) (actual time=0.000..0.000 rows=0 loops=63)

  • Index Cond: ((email_address)::text = ser.email_address)
  • Filter: ((cid = 12,859) AND (email_block_type_id = 15) AND (cid = ser.cid) AND ((created_on)::date >= '2019-12-30'::date) AND ((created_on)::date <= '2020-01-05'::date))
15. 0.015 0.092 ↑ 1.0 128 1

Hash (cost=4.16..4.16 rows=128 width=8) (actual time=0.092..0.092 rows=128 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
16. 0.077 0.077 ↑ 1.0 128 1

Values Scan on ""*VALUES*"" (cost=0.00..4.16 rows=128 width=8) (actual time=0.017..0.077 rows=128 loops=1)