explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 93H2 : Optimization for: Optimization for: plan #Neu3; plan #yaFx

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.010 317.580 ↑ 1.0 1 1

Hash Join (cost=42,922.08..42,954.89 rows=1 width=32) (actual time=317.569..317.580 rows=1 loops=1)

  • Output: (ec.id)::text
  • Inner Unique: true
  • Hash Cond: (ecr.campaign = ec.id)
  • Buffers: shared hit=231,397
2. 0.029 317.534 ↑ 76.3 19 1

HashAggregate (cost=42,897.13..42,911.63 rows=1,450 width=84) (actual time=317.524..317.534 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=231,371
3. 0.008 317.505 ↑ 76.3 19 1

Append (cost=0.70..42,879.00 rows=1,450 width=84) (actual time=49.141..317.505 rows=19 loops=1)

  • Buffers: shared hit=231,371
4. 12.402 59.618 ↑ 39.0 2 1

Nested Loop (cost=0.70..5,243.05 rows=78 width=76) (actual time=49.141..59.618 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: 59,113
  • Buffers: shared hit=20,367
5. 0.011 19.318 ↓ 18.5 37 1

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

  • Output: ec_1.brand, ecr.campaign, ecr.email, ecr.send_type
  • Inner Unique: true
  • Buffers: shared hit=2,560
6. 19.196 19.196 ↓ 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.069..19.196 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: 180,093
  • Buffers: shared hit=2,449
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. 27.898 27.898 ↓ 1.5 1,598 37

Index Scan using contacts_brand_idx on public.contacts c (cost=0.42..33.04 rows=1,077 width=82) (actual time=0.004..0.754 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=17,807
9. 6.049 202.762 ↓ 0.0 0 1

Merge Join (cost=1,294.86..9,904.22 rows=1 width=84) (actual time=202.762..202.762 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=201,247
10. 0.056 145.260 ↑ 315.6 7 1

Nested Loop (cost=1.12..10,749.26 rows=2,209 width=102) (actual time=64.431..145.260 rows=7 loops=1)

  • Output: email_campaigns.id, email_campaigns_recipients.send_type, email_campaigns_recipients.list, contacts.email, contacts.id
  • Buffers: shared hit=96,421
11. 0.055 26.980 ↑ 1.6 72 1

Nested Loop (cost=0.70..6,669.66 rows=114 width=52) (actual time=0.016..26.980 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=4,537
12. 26.709 26.709 ↑ 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.010..26.709 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: 180,058
  • Buffers: shared hit=4,321
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. 118.224 118.224 ↓ 0.0 0 72

Index Scan using contacts_brand_idx on public.contacts (cost=0.42..35.74 rows=5 width=82) (actual time=1.448..1.642 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: 2,809
  • Buffers: shared hit=91,884
15. 51.453 51.453 ↑ 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.010..51.453 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: 92,677
  • Buffers: shared hit=104,826
16. 0.017 18.539 ↓ 0.0 0 1

Hash Join (cost=5,404.32..10,595.65 rows=47 width=84) (actual time=18.539..18.539 rows=0 loops=1)

  • Output: email_campaigns_1.id, contacts_1.email[1], contacts_1.id, NULL::uuid, email_campaigns_recipients_1.send_type
  • Hash Cond: (contacts_1.brand = email_campaigns_1.brand)
  • Join Filter: (ARRAY[email_campaigns_recipients_1.tag] <@ contacts_1.tag)
  • Rows Removed by Join Filter: 4
  • Buffers: shared hit=4,003
17. 0.019 0.037 ↑ 285.6 9 1

Bitmap Heap Scan on public.contacts contacts_1 (cost=58.76..5,010.55 rows=2,570 width=119) (actual time=0.024..0.037 rows=9 loops=1)

  • Output: contacts_1.email, contacts_1.id, contacts_1.tag, contacts_1.brand
  • Recheck Cond: (contacts_1.email[1] = 'rezazarinfar@outlook.com'::text)
  • Filter: ((contacts_1.deleted_at IS NULL) AND (contacts_1.id IS NOT NULL))
  • Heap Blocks: exact=6
  • Buffers: shared hit=9
18. 0.018 0.018 ↑ 528.8 9 1

Bitmap Index Scan on contact_primary_email_idx (cost=0.00..58.12 rows=4,759 width=0) (actual time=0.018..0.018 rows=9 loops=1)

  • Index Cond: (contacts_1.email[1] = 'rezazarinfar@outlook.com'::text)
  • Buffers: shared hit=3
19. 0.113 18.485 ↓ 1.1 515 1

Hash (cost=5,339.50..5,339.50 rows=485 width=47) (actual time=18.485..18.485 rows=515 loops=1)

  • Output: email_campaigns_1.id, email_campaigns_1.brand, email_campaigns_recipients_1.send_type, email_campaigns_recipients_1.tag
  • Buckets: 1,024 Batches: 1 Memory Usage: 48kB
  • Buffers: shared hit=3,994
20. 0.386 18.372 ↓ 1.1 515 1

Nested Loop (cost=0.28..5,339.50 rows=485 width=47) (actual time=0.018..18.372 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=3,994
21. 17.471 17.471 ↓ 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.009..17.471 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: 179,615
  • Buffers: shared hit=2,449
22. 0.515 0.515 ↑ 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.001..0.001 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=1,545
23. 0.033 18.593 ↓ 17.0 17 1

Nested Loop (cost=0.71..5,160.47 rows=1 width=76) (actual time=6.247..18.593 rows=17 loops=1)

  • Output: email_campaigns_2.id, email_campaigns_recipients_2.email, contacts_2.id, NULL::uuid, email_campaigns_recipients_2.send_type
  • Inner Unique: true
  • Join Filter: (email_campaigns_recipients_2.campaign = email_campaigns_2.id)
  • Rows Removed by Join Filter: 233
  • Buffers: shared hit=2,802
24. 0.023 18.424 ↓ 5.7 17 1

Nested Loop (cost=0.42..5,158.27 rows=3 width=76) (actual time=6.215..18.424 rows=17 loops=1)

  • Output: email_campaigns_recipients_2.email, email_campaigns_recipients_2.send_type, email_campaigns_recipients_2.campaign, contacts_2.id, contacts_2.brand
  • Inner Unique: true
  • Buffers: shared hit=2,517
25. 18.347 18.347 ↓ 10.8 54 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_2 (cost=0.00..5,145.04 rows=5 width=60) (actual time=2.801..18.347 rows=54 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) AND (email_campaigns_recipients_2.email = 'rezazarinfar@outlook.com'::text))
  • Rows Removed by Filter: 180,076
  • Buffers: shared hit=2,449
26. 0.054 0.054 ↓ 0.0 0 54

Index Scan using contacts_pkey on public.contacts contacts_2 (cost=0.42..2.64 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=54)

  • Output: contacts_2.id, contacts_2.brand
  • Index Cond: ((contacts_2.id = email_campaigns_recipients_2.contact) AND (contacts_2.id IS NOT NULL))
  • Filter: (contacts_2.deleted_at IS NULL)
  • Buffers: shared hit=68
27. 0.136 0.136 ↑ 1.0 15 17

Index Scan using email_campaigns_brand_idx on public.email_campaigns email_campaigns_2 (cost=0.28..0.55 rows=15 width=32) (actual time=0.002..0.008 rows=15 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.brand = contacts_2.brand)
  • Buffers: shared hit=285
28. 0.008 17.971 ↓ 0.0 0 1

Hash Join (cost=5,087.28..10,094.26 rows=1,318 width=84) (actual time=17.971..17.971 rows=0 loops=1)

  • Output: email_campaigns_3.id, contacts_3.email[1], contacts_3.id, NULL::uuid, email_campaigns_recipients_3.send_type
  • Hash Cond: (contacts_3.brand = email_campaigns_3.brand)
  • Buffers: shared hit=2,950
29. 0.021 0.036 ↑ 95.2 9 1

Bitmap Heap Scan on public.contacts contacts_3 (cost=58.33..5,033.91 rows=857 width=82) (actual time=0.023..0.036 rows=9 loops=1)

  • Output: contacts_3.email, contacts_3.id, contacts_3.brand
  • Recheck Cond: (contacts_3.email[1] = 'rezazarinfar@outlook.com'::text)
  • Filter: ((contacts_3.deleted_at IS NULL) AND (contacts_3.id IS NOT NULL) AND (length(contacts_3.email[1]) > 0))
  • Heap Blocks: exact=6
  • Buffers: shared hit=9
30. 0.015 0.015 ↑ 528.8 9 1

Bitmap Index Scan on contact_primary_email_idx (cost=0.00..58.12 rows=4,759 width=0) (actual time=0.015..0.015 rows=9 loops=1)

  • Index Cond: (contacts_3.email[1] = 'rezazarinfar@outlook.com'::text)
  • Buffers: shared hit=3
31. 0.040 17.927 ↑ 1.2 164 1

Hash (cost=5,026.40..5,026.40 rows=204 width=36) (actual time=17.927..17.927 rows=164 loops=1)

  • Output: email_campaigns_3.id, email_campaigns_3.brand, email_campaigns_recipients_3.send_type
  • Buckets: 1,024 Batches: 1 Memory Usage: 19kB
  • Buffers: shared hit=2,941
32. 0.102 17.887 ↑ 1.2 164 1

Nested Loop (cost=0.28..5,026.40 rows=204 width=36) (actual time=0.014..17.887 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=2,941
33. 17.457 17.457 ↑ 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.007..17.457 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: 179,966
  • Buffers: shared hit=2,449
34. 0.328 0.328 ↑ 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.002..0.002 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
35. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=2.08..1,859.62 rows=4 width=81) (actual time=0.013..0.013 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
36. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=1.82..1,611.87 rows=11 width=113) (actual time=0.012..0.012 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
37. 0.000 0.012 ↓ 0.0 0 1

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

  • Output: ec_2.id, c_1.id, cu."user", u.email, u.id
  • Buffers: shared hit=2
38. 0.001 0.012 ↓ 0.0 0 1

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

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

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

  • Output: u.email, u.id, cu."user", cu.contact
  • Buffers: shared hit=2
40. 0.011 0.011 ↓ 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.011..0.011 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
41. 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
42. 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)
43. 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)
44. 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))
45. 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)
46. 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
47. 0.002 0.036 ↓ 3.0 3 1

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

  • Output: ec.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=26
48. 0.034 0.034 ↓ 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.011..0.034 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.449 ms
Execution time : 317.789 ms