explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gwR

Settings
# exclusive inclusive rows x rows loops node
1. 4.917 111,413.506 ↓ 22,159.0 22,159 1

Unique (cost=249.28..249.31 rows=1 width=64) (actual time=111,407.428..111,413.506 rows=22,159 loops=1)

2. 42.877 111,408.589 ↓ 22,159.0 22,159 1

Sort (cost=249.28..249.28 rows=1 width=64) (actual time=111,407.427..111,408.589 rows=22,159 loops=1)

  • Sort Key: se.scheduled_email_transmission_id, se.property_id, ee.id, ee.delivered_on, ee.opened_on, ee.bounced_on, ee.email_event_type_id, ee.clicked_on, ee.spammed_on, ee.deferred_on
  • Sort Method: quicksort Memory: 2,516kB
3. 23,053.569 111,365.712 ↓ 22,159.0 22,159 1

Nested Loop Left Join (cost=1.57..249.27 rows=1 width=64) (actual time=1.758..111,365.712 rows=22,159 loops=1)

  • Join Filter: (ser.id = ee.system_email_recipient_id)
  • Rows Removed by Join Filter: 285,570,665
4. 14.623 34.671 ↓ 22,158.0 22,158 1

Nested Loop Left Join (cost=1.00..244.62 rows=1 width=20) (actual time=0.102..34.671 rows=22,158 loops=1)

  • Filter: ((se.applicant_id IS NOT NULL) OR (ser.id IS NOT NULL))
  • Rows Removed by Filter: 58
5. 0.350 0.350 ↓ 67.0 67 1

Index Scan using idx_system_emails_custom_partial_cid_pid_sent_on on system_emails se (cost=0.43..239.97 rows=1 width=20) (actual time=0.028..0.350 rows=67 loops=1)

  • Index Cond: ((cid = 12,859) AND (property_id = ANY ('{218059,218060,218061,218062,218063,218064,218065,218066,218067,218068,218069,218070,218071,218072,218073,218074,218075,218076,218077,218078,218079,218080,218081,218082,218083,218084,218085,218087,218088,218089,218090,218092,218093,218094,218095,218096,218097,218098,218099,218100,218101,218102,218103,218104,218105,218106,218107,218108,218109,218110,218111,218112,218113,218114,218115,218116,218118,218119,218120,218121,218122,218123,218124,218126,218127,218128,218129,218130,227292,227294,227295,241633,252494,252495,252496,260128,261521,334998,348949,507160,518395,525519,526083,536150,536151,536152,553957,570963,761510,843826,843827,886853,908584,960652}'::integer[])) AND (sent_on >= '2019-04-01 00:00:00-06'::timestamp with time zone) AND (sent_on <= '2019-04-03 23:59:59.999999-06'::timestamp with time zone) AND (customer_id IS NULL))
  • Filter: ((company_employee_id IS NULL) AND (system_email_type_id = 62))
6. 19.698 19.698 ↓ 331.0 331 67

Index Scan using idx_system_email_recipients_custom_system_email_id on system_email_recipients ser (cost=0.57..4.62 rows=1 width=12) (actual time=0.004..0.294 rows=331 loops=67)

  • Index Cond: ((cid = se.cid) AND (cid = 12,859) AND (recipient_type_id = 1) AND (system_email_id = se.id))
7. 88,277.472 88,277.472 ↓ 12,889.0 12,889 22,158

Index Scan using idx_email_events_system_email_id on email_events ee (cost=0.57..4.62 rows=1 width=68) (actual time=0.007..3.984 rows=12,889 loops=22,158)

  • Index Cond: (system_email_id = se.id)
  • Filter: ((cid = 12,859) AND (cid = se.cid))