explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Neu3

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.011 1,633.623 ↑ 1.0 1 1

Hash Join (cost=130,380.81..130,413.82 rows=1 width=32) (actual time=1,633.611..1,633.623 rows=1 loops=1)

  • Output: (ec.id)::text
  • Inner Unique: true
  • Hash Cond: (ecr.campaign = ec.id)
  • Buffers: shared hit=1007287
2. 0.034 1,633.574 ↑ 76.8 19 1

HashAggregate (cost=130,355.86..130,370.45 rows=1,459 width=84) (actual time=1,633.562..1,633.574 rows=19 loops=1)

  • Output: ecr.campaign, ecr.email, c.id, (NULL::uuid), ecr.send_type
  • Group Key: ecr.campaign, ecr.email, c.id, (NULL::uuid), ecr.send_type
  • Buffers: shared hit=1007261
3. 0.014 1,633.540 ↑ 76.8 19 1

Append (cost=0.70..130,337.62 rows=1,459 width=84) (actual time=49.444..1,633.540 rows=19 loops=1)

  • Buffers: shared hit=1007261
4. 12.383 60.143 ↑ 39.0 2 1

Nested Loop (cost=0.70..5,243.45 rows=78 width=76) (actual time=49.443..60.143 rows=2 loops=1)

  • Output: ecr.campaign, ecr.email, c.id, NULL::uuid, ecr.send_type
  • Join Filter: (c.email && ARRAY[ecr.email])
  • Rows Removed by Join Filter: 59113
  • Buffers: shared hit=20367
5. 0.022 19.418 ↓ 18.5 37 1

Nested Loop (cost=0.28..5,150.04 rows=2 width=60) (actual time=3.226..19.418 rows=37 loops=1)

  • Output: ec_1.brand, ecr.campaign, ecr.email, ecr.send_type
  • Inner Unique: true
  • Buffers: shared hit=2560
6. 19.285 19.285 ↓ 18.5 37 1

Seq Scan on public.email_campaigns_recipients ecr (cost=0.00..5,145.04 rows=2 width=44) (actual time=3.215..19.285 rows=37 loops=1)

  • Output: ecr.id, ecr.created_at, ecr.updated_at, ecr.deleted_at, ecr.campaign, ecr.tag, ecr.list, ecr.contact, ecr.email, ecr.send_type, ecr.recipient_type, ecr.brand, ecr.agent
  • Filter: ((ecr.email IS NOT NULL) AND (ecr.contact IS NULL) AND (ecr.deleted_at IS NULL) AND (ecr.recipient_type = 'Email'::email_campaign_recipient_type) AND (ecr.email = 'rezazarinfar@outlook.com'::text))
  • Rows Removed by Filter: 180092
  • Buffers: shared hit=2449
7. 0.111 0.111 ↑ 1.0 1 37

Index Scan using email_campaigns_pkey on public.email_campaigns ec_1 (cost=0.28..2.50 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=37)

  • Output: ec_1.id, ec_1.created_at, ec_1.updated_at, ec_1.deleted_at, ec_1.created_by, ec_1.brand, ec_1.subject, ec_1.include_signature, ec_1.html, ec_1.due_at, ec_1.executed_at, ec_1."from", ec_1.individual, ec_1.accepted, ec_1.rejected, ec_1.delivered, ec_1.failed, ec_1.opened, ec_1.clicked, ec_1.unsubscribed, ec_1.complained, ec_1.stored, ec_1.template, ec_1.deal, ec_1.text, ec_1.headers, ec_1.google_credential, ec_1.microsoft_credential, ec_1.thread_key
  • Index Cond: (ec_1.id = ecr.campaign)
  • Buffers: shared hit=111
8. 28.342 28.342 ↓ 1.5 1,598 37

Index Scan using contacts_brand_idx on public.contacts c (cost=0.42..33.16 rows=1,084 width=82) (actual time=0.004..0.766 rows=1,598 loops=37)

  • Output: c.id, c.email, c.brand
  • Index Cond: (c.brand = ec_1.brand)
  • Filter: (c.id IS NOT NULL)
  • Buffers: shared hit=17807
9. 6.190 204.156 ↓ 0.0 0 1

Merge Join (cost=1,294.86..9,904.23 rows=1 width=84) (actual time=204.156..204.156 rows=0 loops=1)

  • Output: email_campaigns.id, contacts.email[1], contacts.id, NULL::uuid, email_campaigns_recipients.send_type
  • Inner Unique: true
  • Merge Cond: (email_campaigns_recipients.list = crm_lists_members.list)
  • Join Filter: (contacts.id = crm_lists_members.contact)
  • Rows Removed by Join Filter: 9
  • Buffers: shared hit=201251
10. 0.013 146.340 ↑ 317.6 7 1

Nested Loop (cost=1.12..10,763.99 rows=2,223 width=102) (actual time=67.343..146.340 rows=7 loops=1)

  • Output: email_campaigns.id, email_campaigns_recipients.send_type, email_campaigns_recipients.list, contacts.email, contacts.id
  • Buffers: shared hit=96425
11. 0.071 26.951 ↑ 1.6 72 1

Nested Loop (cost=0.70..6,669.66 rows=114 width=52) (actual time=0.022..26.951 rows=72 loops=1)

  • Output: email_campaigns.id, email_campaigns.brand, email_campaigns_recipients.send_type, email_campaigns_recipients.list
  • Inner Unique: true
  • Buffers: shared hit=4537
12. 26.664 26.664 ↑ 1.6 72 1

Index Scan using email_campaigns_recipients_list_idx on public.email_campaigns_recipients (cost=0.42..6,451.76 rows=114 width=36) (actual time=0.013..26.664 rows=72 loops=1)

  • Output: email_campaigns_recipients.id, email_campaigns_recipients.created_at, email_campaigns_recipients.updated_at, email_campaigns_recipients.deleted_at, email_campaigns_recipients.campaign, email_campaigns_recipients.tag, email_campaigns_recipients.list, email_campaigns_recipients.contact, email_campaigns_recipients.email, email_campaigns_recipients.send_type, email_campaigns_recipients.recipient_type, email_campaigns_recipients.brand, email_campaigns_recipients.agent
  • Filter: (email_campaigns_recipients.recipient_type = 'List'::email_campaign_recipient_type)
  • Rows Removed by Filter: 180057
  • Buffers: shared hit=4321
13. 0.216 0.216 ↑ 1.0 1 72

Index Scan using email_campaigns_pkey on public.email_campaigns (cost=0.28..1.91 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=72)

  • Output: email_campaigns.id, email_campaigns.created_at, email_campaigns.updated_at, email_campaigns.deleted_at, email_campaigns.created_by, email_campaigns.brand, email_campaigns.subject, email_campaigns.include_signature, email_campaigns.html, email_campaigns.due_at, email_campaigns.executed_at, email_campaigns."from", email_campaigns.individual, email_campaigns.accepted, email_campaigns.rejected, email_campaigns.delivered, email_campaigns.failed, email_campaigns.opened, email_campaigns.clicked, email_campaigns.unsubscribed, email_campaigns.complained, email_campaigns.stored, email_campaigns.template, email_campaigns.deal, email_campaigns.text, email_campaigns.headers, email_campaigns.google_credential, email_campaigns.microsoft_credential, email_campaigns.thread_key
  • Index Cond: (email_campaigns.id = email_campaigns_recipients.campaign)
  • Buffers: shared hit=216
14. 119.376 119.376 ↓ 0.0 0 72

Index Scan using contacts_brand_idx on public.contacts (cost=0.42..35.87 rows=5 width=82) (actual time=1.463..1.658 rows=0 loops=72)

  • Output: contacts.email, contacts.id, contacts.brand
  • Index Cond: (contacts.brand = email_campaigns.brand)
  • Filter: ((contacts.id IS NOT NULL) AND (contacts.email[1] = 'rezazarinfar@outlook.com'::text))
  • Rows Removed by Filter: 2809
  • Buffers: shared hit=91888
15. 51.626 51.626 ↑ 1.6 97,232 1

Index Scan using contact_lists_members_pkey on public.crm_lists_members (cost=0.42..9,508.06 rows=153,466 width=32) (actual time=0.011..51.626 rows=97,232 loops=1)

  • Output: crm_lists_members.list, crm_lists_members.contact, crm_lists_members.is_manual, crm_lists_members.created_at, crm_lists_members.deleted_at
  • Filter: (crm_lists_members.deleted_at IS NULL)
  • Rows Removed by Filter: 92677
  • Buffers: shared hit=104826
16. 0.049 752.576 ↓ 0.0 0 1

Nested Loop (cost=0.70..22,764.43 rows=47 width=84) (actual time=752.576..752.576 rows=0 loops=1)

  • Output: email_campaigns_1.id, contacts_1.email[1], contacts_1.id, NULL::uuid, email_campaigns_recipients_1.send_type
  • Join Filter: (ARRAY[email_campaigns_recipients_1.tag] <@ contacts_1.tag)
  • Rows Removed by Join Filter: 4
  • Buffers: shared hit=610983
17. 0.691 19.682 ↓ 1.1 515 1

Nested Loop (cost=0.28..5,339.50 rows=485 width=47) (actual time=0.023..19.682 rows=515 loops=1)

  • Output: email_campaigns_1.id, email_campaigns_1.brand, email_campaigns_recipients_1.send_type, email_campaigns_recipients_1.tag
  • Inner Unique: true
  • Buffers: shared hit=3994
18. 17.961 17.961 ↓ 1.1 515 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_1 (cost=0.00..4,695.70 rows=485 width=31) (actual time=0.012..17.961 rows=515 loops=1)

  • Output: email_campaigns_recipients_1.id, email_campaigns_recipients_1.created_at, email_campaigns_recipients_1.updated_at, email_campaigns_recipients_1.deleted_at, email_campaigns_recipients_1.campaign, email_campaigns_recipients_1.tag, email_campaigns_recipients_1.list, email_campaigns_recipients_1.contact, email_campaigns_recipients_1.email, email_campaigns_recipients_1.send_type, email_campaigns_recipients_1.recipient_type, email_campaigns_recipients_1.brand, email_campaigns_recipients_1.agent
  • Filter: (email_campaigns_recipients_1.recipient_type = 'Tag'::email_campaign_recipient_type)
  • Rows Removed by Filter: 179614
  • Buffers: shared hit=2449
19. 1.030 1.030 ↑ 1.0 1 515

Index Scan using email_campaigns_pkey on public.email_campaigns email_campaigns_1 (cost=0.28..1.33 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=515)

  • Output: email_campaigns_1.id, email_campaigns_1.created_at, email_campaigns_1.updated_at, email_campaigns_1.deleted_at, email_campaigns_1.created_by, email_campaigns_1.brand, email_campaigns_1.subject, email_campaigns_1.include_signature, email_campaigns_1.html, email_campaigns_1.due_at, email_campaigns_1.executed_at, email_campaigns_1."from", email_campaigns_1.individual, email_campaigns_1.accepted, email_campaigns_1.rejected, email_campaigns_1.delivered, email_campaigns_1.failed, email_campaigns_1.opened, email_campaigns_1.clicked, email_campaigns_1.unsubscribed, email_campaigns_1.complained, email_campaigns_1.stored, email_campaigns_1.template, email_campaigns_1.deal, email_campaigns_1.text, email_campaigns_1.headers, email_campaigns_1.google_credential, email_campaigns_1.microsoft_credential, email_campaigns_1.thread_key
  • Index Cond: (email_campaigns_1.id = email_campaigns_recipients_1.campaign)
  • Buffers: shared hit=1545
20. 732.845 732.845 ↓ 0.0 0 515

Index Scan using contacts_brand_idx on public.contacts contacts_1 (cost=0.42..35.87 rows=5 width=119) (actual time=1.399..1.423 rows=0 loops=515)

  • Output: contacts_1.email, contacts_1.id, contacts_1.tag, contacts_1.brand
  • Index Cond: (contacts_1.brand = email_campaigns_1.brand)
  • Filter: ((contacts_1.id IS NOT NULL) AND (contacts_1.email[1] = 'rezazarinfar@outlook.com'::text))
  • Rows Removed by Filter: 2717
  • Buffers: shared hit=606989
21. 0.029 429.158 ↓ 8.5 17 1

Nested Loop (cost=72,072.43..77,091.36 rows=2 width=84) (actual time=412.990..429.158 rows=17 loops=1)

  • Output: email_campaigns_2.id, COALESCE(email_campaigns_recipients_2.email, contacts_2.email[1]), contacts_2.id, NULL::uuid, email_campaigns_recipients_2.send_type
  • Inner Unique: true
  • Join Filter: (contacts_2.brand = email_campaigns_2.brand)
  • Buffers: shared hit=58529
22. 7.154 429.078 ↑ 14.6 17 1

Hash Join (cost=72,072.15..77,010.29 rows=249 width=126) (actual time=412.974..429.078 rows=17 loops=1)

  • Output: email_campaigns_recipients_2.email, email_campaigns_recipients_2.send_type, email_campaigns_recipients_2.campaign, contacts_2.email, contacts_2.id, contacts_2.brand
  • Inner Unique: true
  • Hash Cond: (email_campaigns_recipients_2.contact = contacts_2.id)
  • Join Filter: (COALESCE(email_campaigns_recipients_2.email, contacts_2.email[1]) = 'rezazarinfar@outlook.com'::text)
  • Rows Removed by Join Filter: 4680
  • Buffers: shared hit=58478
23. 21.588 21.588 ↑ 1.0 90,337 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_2 (cost=0.00..4,695.70 rows=92,360 width=60) (actual time=0.010..21.588 rows=90,337 loops=1)

  • Output: email_campaigns_recipients_2.id, email_campaigns_recipients_2.created_at, email_campaigns_recipients_2.updated_at, email_campaigns_recipients_2.deleted_at, email_campaigns_recipients_2.campaign, email_campaigns_recipients_2.tag, email_campaigns_recipients_2.list, email_campaigns_recipients_2.contact, email_campaigns_recipients_2.email, email_campaigns_recipients_2.send_type, email_campaigns_recipients_2.recipient_type, email_campaigns_recipients_2.brand, email_campaigns_recipients_2.agent
  • Filter: (email_campaigns_recipients_2.recipient_type = 'Email'::email_campaign_recipient_type)
  • Rows Removed by Filter: 89792
  • Buffers: shared hit=2449
24. 120.363 400.336 ↑ 1.0 509,069 1

Hash (cost=65,606.52..65,606.52 rows=517,250 width=82) (actual time=400.336..400.336 rows=509,069 loops=1)

  • Output: contacts_2.email, contacts_2.id, contacts_2.brand
  • Buckets: 524288 Batches: 1 Memory Usage: 52273kB
  • Buffers: shared hit=56029
25. 279.973 279.973 ↑ 1.0 509,069 1

Seq Scan on public.contacts contacts_2 (cost=0.00..65,606.52 rows=517,250 width=82) (actual time=0.008..279.973 rows=509,069 loops=1)

  • Output: contacts_2.email, contacts_2.id, contacts_2.brand
  • Filter: ((contacts_2.deleted_at IS NULL) AND (contacts_2.id IS NOT NULL))
  • Rows Removed by Filter: 441974
  • Buffers: shared hit=56029
26. 0.051 0.051 ↑ 1.0 1 17

Index Scan using email_campaigns_pkey on public.email_campaigns email_campaigns_2 (cost=0.28..0.31 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=17)

  • Output: email_campaigns_2.id, email_campaigns_2.created_at, email_campaigns_2.updated_at, email_campaigns_2.deleted_at, email_campaigns_2.created_by, email_campaigns_2.brand, email_campaigns_2.subject, email_campaigns_2.include_signature, email_campaigns_2.html, email_campaigns_2.due_at, email_campaigns_2.executed_at, email_campaigns_2."from", email_campaigns_2.individual, email_campaigns_2.accepted, email_campaigns_2.rejected, email_campaigns_2.delivered, email_campaigns_2.failed, email_campaigns_2.opened, email_campaigns_2.clicked, email_campaigns_2.unsubscribed, email_campaigns_2.complained, email_campaigns_2.stored, email_campaigns_2.template, email_campaigns_2.deal, email_campaigns_2.text, email_campaigns_2.headers, email_campaigns_2.google_credential, email_campaigns_2.microsoft_credential, email_campaigns_2.thread_key
  • Index Cond: (email_campaigns_2.id = email_campaigns_recipients_2.campaign)
  • Buffers: shared hit=51
27. 0.073 187.478 ↓ 0.0 0 1

Nested Loop (cost=0.70..13,452.66 rows=1,326 width=84) (actual time=187.477..187.478 rows=0 loops=1)

  • Output: email_campaigns_3.id, contacts_3.email[1], contacts_3.id, NULL::uuid, email_campaigns_recipients_3.send_type
  • Buffers: shared hit=116129
28. 0.123 18.649 ↑ 1.2 164 1

Nested Loop (cost=0.28..5,026.40 rows=204 width=36) (actual time=0.016..18.649 rows=164 loops=1)

  • Output: email_campaigns_3.id, email_campaigns_3.brand, email_campaigns_recipients_3.send_type
  • Inner Unique: true
  • Buffers: shared hit=2941
29. 18.034 18.034 ↑ 1.2 164 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_3 (cost=0.00..4,695.70 rows=204 width=20) (actual time=0.010..18.034 rows=164 loops=1)

  • Output: email_campaigns_recipients_3.id, email_campaigns_recipients_3.created_at, email_campaigns_recipients_3.updated_at, email_campaigns_recipients_3.deleted_at, email_campaigns_recipients_3.campaign, email_campaigns_recipients_3.tag, email_campaigns_recipients_3.list, email_campaigns_recipients_3.contact, email_campaigns_recipients_3.email, email_campaigns_recipients_3.send_type, email_campaigns_recipients_3.recipient_type, email_campaigns_recipients_3.brand, email_campaigns_recipients_3.agent
  • Filter: (email_campaigns_recipients_3.recipient_type = 'AllContacts'::email_campaign_recipient_type)
  • Rows Removed by Filter: 179965
  • Buffers: shared hit=2449
30. 0.492 0.492 ↑ 1.0 1 164

Index Scan using email_campaigns_pkey on public.email_campaigns email_campaigns_3 (cost=0.28..1.62 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=164)

  • Output: email_campaigns_3.id, email_campaigns_3.created_at, email_campaigns_3.updated_at, email_campaigns_3.deleted_at, email_campaigns_3.created_by, email_campaigns_3.brand, email_campaigns_3.subject, email_campaigns_3.include_signature, email_campaigns_3.html, email_campaigns_3.due_at, email_campaigns_3.executed_at, email_campaigns_3."from", email_campaigns_3.individual, email_campaigns_3.accepted, email_campaigns_3.rejected, email_campaigns_3.delivered, email_campaigns_3.failed, email_campaigns_3.opened, email_campaigns_3.clicked, email_campaigns_3.unsubscribed, email_campaigns_3.complained, email_campaigns_3.stored, email_campaigns_3.template, email_campaigns_3.deal, email_campaigns_3.text, email_campaigns_3.headers, email_campaigns_3.google_credential, email_campaigns_3.microsoft_credential, email_campaigns_3.thread_key
  • Index Cond: (email_campaigns_3.id = email_campaigns_recipients_3.campaign)
  • Buffers: shared hit=492
31. 168.756 168.756 ↓ 0.0 0 164

Index Scan using contacts_brand_idx on public.contacts contacts_3 (cost=0.42..41.29 rows=2 width=82) (actual time=1.029..1.029 rows=0 loops=164)

  • Output: contacts_3.email, contacts_3.id, contacts_3.brand
  • Index Cond: (contacts_3.brand = email_campaigns_3.brand)
  • Filter: ((contacts_3.id IS NOT NULL) AND (contacts_3.email[1] = 'rezazarinfar@outlook.com'::text) AND (length(contacts_3.email[1]) > 0))
  • Rows Removed by Filter: 1709
  • Buffers: shared hit=113188
32. 0.000 0.014 ↓ 0.0 0 1

Nested Loop (cost=2.08..1,859.62 rows=4 width=81) (actual time=0.014..0.014 rows=0 loops=1)

  • Output: ec_2.id, u.email, c_1.id, NULL::uuid, ecr_1.send_type
  • Join Filter: (u.id = ba."user")
  • Buffers: shared hit=2
33. 0.001 0.014 ↓ 0.0 0 1

Nested Loop (cost=1.82..1,611.87 rows=11 width=113) (actual time=0.014..0.014 rows=0 loops=1)

  • Output: ec_2.id, ecr_1.send_type, ecr_1.brand, c_1.id, cu."user", u.email, u.id
  • Buffers: shared hit=2
34. 0.000 0.013 ↓ 0.0 0 1

Nested Loop (cost=1.41..1,024.56 rows=156 width=93) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: ec_2.id, c_1.id, cu."user", u.email, u.id
  • Buffers: shared hit=2
35. 0.000 0.013 ↓ 0.0 0 1

Nested Loop (cost=1.12..1,021.77 rows=4 width=93) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: u.email, u.id, cu."user", c_1.id, c_1.brand
  • Inner Unique: true
  • Buffers: shared hit=2
36. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=0.70..1,011.83 rows=8 width=77) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: u.email, u.id, cu."user", cu.contact
  • Buffers: shared hit=2
37. 0.012 0.012 ↓ 0.0 0 1

Index Scan using users_email_key on public.users u (cost=0.28..2.50 rows=1 width=45) (actual time=0.012..0.012 rows=0 loops=1)

  • Output: u.username, u.first_name, u.last_name, u.email, u.phone_number, u.created_at, u.id, u.password, u.address_id, u.cover_image_url, u.profile_image_url, u.updated_at, u.user_status, u.profile_image_thumbnail_url, u.cover_image_thumbnail_url, u.email_confirmed, u.timezone, u.user_type, u.deleted_at, u.phone_confirmed, u.agent, u.secondary_password, u.is_shadow, u.personal_room, u.brand, u.fake_email, u.features, u.last_seen_at, u.last_seen_by, u.email_signature
  • Index Cond: (u.email = 'rezazarinfar@outlook.com'::text)
  • Buffers: shared hit=2
38. 0.000 0.000 ↓ 0.0 0

Index Only Scan using contacts_users_idx on public.contacts_users cu (cost=0.41..1,009.14 rows=19 width=32) (never executed)

  • Output: cu.contact, cu."user
  • Index Cond: (cu."user" = u.id)
  • Heap Fetches: 0
39. 0.000 0.000 ↓ 0.0 0

Index Scan using contacts_pkey on public.contacts c_1 (cost=0.42..1.24 rows=1 width=32) (never executed)

  • Output: c_1.id, c_1.brand
  • Index Cond: ((c_1.id = cu.contact) AND (c_1.id IS NOT NULL))
  • Filter: (c_1.deleted_at IS NULL)
40. 0.000 0.000 ↓ 0.0 0

Index Scan using email_campaigns_brand_idx on public.email_campaigns ec_2 (cost=0.28..0.55 rows=15 width=32) (never executed)

  • Output: ec_2.id, ec_2.created_at, ec_2.updated_at, ec_2.deleted_at, ec_2.created_by, ec_2.brand, ec_2.subject, ec_2.include_signature, ec_2.html, ec_2.due_at, ec_2.executed_at, ec_2."from", ec_2.individual, ec_2.accepted, ec_2.rejected, ec_2.delivered, ec_2.failed, ec_2.opened, ec_2.clicked, ec_2.unsubscribed, ec_2.complained, ec_2.stored, ec_2.template, ec_2.deal, ec_2.text, ec_2.headers, ec_2.google_credential, ec_2.microsoft_credential, ec_2.thread_key
  • Index Cond: (ec_2.brand = c_1.brand)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using email_campaigns_recipients_campaign_idx on public.email_campaigns_recipients ecr_1 (cost=0.42..3.75 rows=1 width=36) (never executed)

  • Output: ecr_1.id, ecr_1.created_at, ecr_1.updated_at, ecr_1.deleted_at, ecr_1.campaign, ecr_1.tag, ecr_1.list, ecr_1.contact, ecr_1.email, ecr_1.send_type, ecr_1.recipient_type, ecr_1.brand, ecr_1.agent
  • Index Cond: (ecr_1.campaign = ec_2.id)
  • Filter: ((ecr_1.deleted_at IS NULL) AND (ecr_1.recipient_type = 'Brand'::email_campaign_recipient_type))
42. 0.000 0.000 ↓ 0.0 0

Function Scan on public.get_brand_agents ba (cost=0.25..10.25 rows=1,000 width=16) (never executed)

  • Output: ba."user", ba.agent, ba.mui, ba.mls, ba.brand_user, ba.brand_role, ba.brand, ba.enabled
  • Function Call: get_brand_agents(ecr_1.brand)
43. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=75) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: id, email, NULL::uuid, agent, send_type
  • One-Time Filter: false
44. 0.002 0.038 ↓ 3.0 3 1

Hash (cost=24.94..24.94 rows=1 width=16) (actual time=0.038..0.038 rows=3 loops=1)

  • Output: ec.id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=26
45. 0.036 0.036 ↓ 3.0 3 1

Index Scan using email_campaigns_brand_idx on public.email_campaigns ec (cost=0.28..24.94 rows=1 width=16) (actual time=0.013..0.036 rows=3 loops=1)

  • Output: ec.id
  • Index Cond: (ec.brand = 'fca6efa6-2f91-11ea-b7a0-0a653b6fef3e'::uuid)
  • Filter: ((ec.deleted_at IS NULL) AND (ec.executed_at IS NULL) AND (ec.due_at IS NOT NULL) AND (ec.due_at >= '2020-01-07 20:29:59.79+00'::timestamp with time zone) AND (ec.due_at <= '2020-03-31 23:59:59.999+00'::timestamp with time zone))
  • Rows Removed by Filter: 21
  • Buffers: shared hit=26
Planning time : 4.901 ms
Execution time : 1,634.059 ms