explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zT6 : Optimization for: Optimization for: plan #dLjQ; plan #Zphw

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.038 3,045.075 ↓ 63.0 63 1

Nested Loop Left Join (cost=107,308.63..138,082.55 rows=1 width=172) (actual time=2,842.648..3,045.075 rows=63 loops=1)

  • Join Filter: ((se.cid = 12859) 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[])))
2. 0.056 3,044.974 ↓ 63.0 63 1

Nested Loop Left Join (cost=107,308.48..138,078.30 rows=1 width=148) (actual time=2,842.643..3,044.974 rows=63 loops=1)

3. 2,185.247 3,044.162 ↓ 63.0 63 1

Bitmap Heap Scan on system_emails se (cost=107,307.91..138,073.65 rows=1 width=84) (actual time=2,842.600..3,044.162 rows=63 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 = 12859))
  • Filter: ((applicant_id IS NOT NULL) AND (customer_id IS NULL) AND (company_employee_id IS NULL) AND ((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: 576492
  • Heap Blocks: exact=368674
4. 48.358 858.915 ↓ 0.0 0 1

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

5. 93.243 93.243 ↑ 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.243..93.243 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[]))
6. 717.314 717.314 ↑ 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=717.314..717.314 rows=3,234,219 loops=1)

  • Index Cond: (cid = 12859)
7. 0.756 0.756 ↑ 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.012..0.012 rows=1 loops=63)

  • Index Cond: (se.id = system_email_id)
  • Filter: ((cid = 12859) AND (se.cid = cid))
8. 0.063 0.063 ↓ 0.0 0 63

Index Scan using idx_temp_scheduled_task_logs_events on scheduled_task_logs_events stle (cost=0.14..4.19 rows=1 width=44) (actual time=0.001..0.001 rows=0 loops=63)

  • Index Cond: ((se.cid = cid) AND (cid = 12859) AND (se.property_id = property_id) AND (se.scheduled_task_log_id = scheduled_task_log_id))
Planning time : 2.479 ms