explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CbR1

Settings
# exclusive inclusive rows x rows loops node
1. 5.107 100,853.513 ↓ 22,777.0 22,777 1

Unique (cost=245.22..245.25 rows=1 width=64) (actual time=100,847.234..100,853.513 rows=22,777 loops=1)

2. 35.631 100,848.406 ↓ 22,777.0 22,777 1

Sort (cost=245.22..245.23 rows=1 width=64) (actual time=100,847.233..100,848.406 rows=22,777 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,565kB
3. 22,750.867 100,812.775 ↓ 22,777.0 22,777 1

Nested Loop Left Join (cost=1.57..245.21 rows=1 width=64) (actual time=10.781..100,812.775 rows=22,777 loops=1)

  • Join Filter: (ser.id = ee.system_email_recipient_id)
  • Rows Removed by Join Filter: 285,690,401
4. 9.306 167.988 ↓ 22,776.0 22,776 1

Nested Loop Left Join (cost=1.00..240.56 rows=1 width=20) (actual time=0.153..167.988 rows=22,776 loops=1)

  • Filter: ((se.applicant_id IS NOT NULL) OR (ser.id IS NOT NULL))
  • Rows Removed by Filter: 67
5. 2.227 2.227 ↓ 83.0 83 1

Index Scan using idx_system_emails_custom_partial_cid_pid_sent_on on system_emails se (cost=0.43..235.92 rows=1 width=20) (actual time=0.025..2.227 rows=83 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-05 00:00:00-06'::timestamp with time zone) AND (customer_id IS NULL))
  • Filter: ((company_employee_id IS NULL) AND (system_email_type_id = 62))
6. 156.455 156.455 ↓ 274.0 274 83

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.011..1.885 rows=274 loops=83)

  • Index Cond: ((cid = se.cid) AND (cid = 12,859) AND (recipient_type_id = 1) AND (system_email_id = se.id))
7. 77,893.920 77,893.920 ↓ 12,544.0 12,544 22,776

Index Scan using idx_email_events_system_email_id on email_events ee (cost=0.57..4.61 rows=1 width=68) (actual time=0.007..3.420 rows=12,544 loops=22,776)

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