explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nl4k

Settings
# exclusive inclusive rows x rows loops node
1. 0.407 7,052.370 ↓ 0.0 0 1

Hash Join (cost=903,911.67..949,562.00 rows=5 width=16) (actual time=7,052.370..7,052.370 rows=0 loops=1)

  • Output: ec.id
  • Inner Unique: true
  • Hash Cond: (ec.brand = c.brand)
  • Join Filter: (c.email && ARRAY[ecr.email])
  • Rows Removed by Join Filter: 5
  • Buffers: shared hit=3738702
2. 39.793 7,051.942 ↑ 13.3 4,384 1

Hash Join (cost=903,909.02..949,406.77 rows=58,097 width=64) (actual time=6,871.394..7,051.942 rows=4,384 loops=1)

  • Output: ec.id, ec.brand, ecr.email
  • Inner Unique: true
  • Hash Cond: (ecr.campaign = ec.id)
  • Buffers: shared hit=3738698
3. 428.889 7,010.434 ↑ 3.9 519,907 1

HashAggregate (cost=903,051.46..923,158.94 rows=2,010,748 width=84) (actual time=6,869.639..7,010.434 rows=519,907 loops=1)

  • Output: ecr.campaign, ecr.email, c_1.id, (NULL::uuid), ecr.send_type
  • Group Key: ecr.campaign, ecr.email, c_1.id, (NULL::uuid), ecr.send_type
  • Buffers: shared hit=3737891
4. 58.705 6,581.545 ↑ 3.6 565,607 1

Append (cost=917.77..877,917.11 rows=2,010,748 width=84) (actual time=1.910..6,581.545 rows=565,607 loops=1)

  • Buffers: shared hit=3737891
5. 94.794 2,016.327 ↑ 238.9 7,319 1

Nested Loop (cost=917.77..599,495.01 rows=1,748,329 width=76) (actual time=1.909..2,016.327 rows=7,319 loops=1)

  • Output: ecr.campaign, ecr.email, c_1.id, NULL::uuid, ecr.send_type
  • Buffers: shared hit=673251
6. 21.480 56.857 ↓ 1.9 84,758 1

Hash Join (cost=916.80..5,820.12 rows=44,097 width=60) (actual time=1.802..56.857 rows=84,758 loops=1)

  • Output: ec_1.brand, ecr.campaign, ecr.email, ecr.send_type
  • Inner Unique: true
  • Hash Cond: (ecr.campaign = ec_1.id)
  • Buffers: shared hit=3258
7. 33.599 33.599 ↓ 1.9 84,758 1

Seq Scan on public.email_campaigns_recipients ecr (cost=0.00..4,787.46 rows=44,097 width=44) (actual time=0.008..33.599 rows=84,758 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))
  • Rows Removed by Filter: 102479
  • Buffers: shared hit=2451
8. 0.650 1.778 ↑ 1.0 4,880 1

Hash (cost=855.80..855.80 rows=4,880 width=32) (actual time=1.778..1.778 rows=4,880 loops=1)

  • Output: ec_1.id, ec_1.brand
  • Buckets: 8192 Batches: 1 Memory Usage: 369kB
  • Buffers: shared hit=807
9. 1.128 1.128 ↑ 1.0 4,880 1

Seq Scan on public.email_campaigns ec_1 (cost=0.00..855.80 rows=4,880 width=32) (actual time=0.003..1.128 rows=4,880 loops=1)

  • Output: ec_1.id, ec_1.brand
  • Buffers: shared hit=807
10. 0.000 1,864.676 ↓ 0.0 0 84,758

Bitmap Heap Scan on public.contacts c_1 (cost=0.97..13.35 rows=11 width=82) (actual time=0.022..0.022 rows=0 loops=84,758)

  • Output: c_1.id, c_1.email, c_1.brand
  • Recheck Cond: ((c_1.brand = ec_1.brand) AND (c_1.email && ARRAY[ecr.email]))
  • Filter: ((c_1.deleted_at IS NULL) AND (c_1.id IS NOT NULL))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=7914
  • Buffers: shared hit=669993
11. 1,864.676 1,864.676 ↓ 0.0 0 84,758

Bitmap Index Scan on contacts_brand_email_idx (cost=0.00..0.97 rows=20 width=0) (actual time=0.022..0.022 rows=0 loops=84,758)

  • Index Cond: ((c_1.brand = ec_1.brand) AND (c_1.email && ARRAY[ecr.email]))
  • Buffers: shared hit=662079
12. 37.789 280.972 ↓ 25,489.0 25,489 1

Nested Loop (cost=1.13..9,179.72 rows=1 width=84) (actual time=0.443..280.972 rows=25,489 loops=1)

  • Output: email_campaigns.id, contacts.email[1], contacts.id, NULL::uuid, email_campaigns_recipients.send_type
  • Inner Unique: true
  • Join Filter: (email_campaigns_recipients.campaign = email_campaigns.id)
  • Rows Removed by Join Filter: 333622
  • Buffers: shared hit=521725
13. 5.888 115.738 ↓ 5,097.8 25,489 1

Nested Loop (cost=0.85..9,176.05 rows=5 width=102) (actual time=0.408..115.738 rows=25,489 loops=1)

  • Output: email_campaigns_recipients.send_type, email_campaigns_recipients.campaign, contacts.email, contacts.id, contacts.brand
  • Inner Unique: true
  • Buffers: shared hit=115087
14. 3.144 33.383 ↓ 2,832.1 25,489 1

Nested Loop (cost=0.42..9,168.18 rows=9 width=36) (actual time=0.396..33.383 rows=25,489 loops=1)

  • Output: email_campaigns_recipients.send_type, email_campaigns_recipients.campaign, crm_lists_members.contact
  • Buffers: shared hit=13016
15. 19.727 19.727 ↓ 1.0 72 1

Seq Scan on public.email_campaigns_recipients (cost=0.00..4,787.46 rows=69 width=36) (actual time=0.382..19.727 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: 187165
  • Buffers: shared hit=2451
16. 10.512 10.512 ↑ 1.0 354 72

Index Scan using contact_lists_members_pkey on public.crm_lists_members (cost=0.42..59.78 rows=371 width=32) (actual time=0.012..0.146 rows=354 loops=72)

  • Output: crm_lists_members.list, crm_lists_members.contact, crm_lists_members.is_manual, crm_lists_members.created_at, crm_lists_members.deleted_at
  • Index Cond: (crm_lists_members.list = email_campaigns_recipients.list)
  • Filter: (crm_lists_members.deleted_at IS NULL)
  • Rows Removed by Filter: 44
  • Buffers: shared hit=10565
17. 76.467 76.467 ↑ 1.0 1 25,489

Index Scan using contacts_pkey on public.contacts (cost=0.42..0.87 rows=1 width=82) (actual time=0.003..0.003 rows=1 loops=25,489)

  • Output: contacts.email, contacts.id, contacts.brand
  • Index Cond: ((contacts.id = crm_lists_members.contact) AND (contacts.id IS NOT NULL))
  • Filter: (contacts.deleted_at IS NULL)
  • Buffers: shared hit=102071
18. 127.445 127.445 ↑ 1.1 14 25,489

Index Scan using email_campaigns_brand_idx on public.email_campaigns (cost=0.28..0.55 rows=15 width=32) (actual time=0.001..0.005 rows=14 loops=25,489)

  • 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.brand = contacts.brand)
  • Buffers: shared hit=406638
19. 434.690 1,529.743 ↓ 23.7 284,107 1

Nested Loop (cost=0.70..33,166.68 rows=11,973 width=84) (actual time=0.044..1,529.743 rows=284,107 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: 1111739
  • Buffers: shared hit=587499
20. 1.151 30.545 ↑ 1.2 516 1

Nested Loop (cost=0.28..5,477.96 rows=604 width=47) (actual time=0.020..30.545 rows=516 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=4003
21. 23.718 23.718 ↑ 1.2 516 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_1 (cost=0.00..4,787.46 rows=604 width=31) (actual time=0.009..23.718 rows=516 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: 186721
  • Buffers: shared hit=2451
22. 5.676 5.676 ↑ 1.0 1 516

Index Scan using email_campaigns_pkey on public.email_campaigns email_campaigns_1 (cost=0.28..1.14 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=516)

  • 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=1552
23. 1,064.508 1,064.508 ↓ 2.5 2,705 516

Index Scan using contacts_brand_idx on public.contacts contacts_1 (cost=0.42..32.43 rows=1,073 width=118) (actual time=0.006..2.063 rows=2,705 loops=516)

  • 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)
  • Buffers: shared hit=583496
24. 1.622 534.174 ↓ 9.5 3,665 1

Hash Join (cost=72,440.19..77,727.60 rows=384 width=76) (actual time=498.034..534.174 rows=3,665 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
  • Hash Cond: ((email_campaigns_recipients_2.campaign = email_campaigns_2.id) AND (contacts_2.brand = email_campaigns_2.brand))
  • Buffers: shared hit=58920
25. 8.150 529.955 ↑ 10.2 4,817 1

Hash Join (cost=71,511.19..76,540.81 rows=49,102 width=76) (actual time=495.418..529.955 rows=4,817 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
  • Hash Cond: (email_campaigns_recipients_2.contact = contacts_2.id)
  • Buffers: shared hit=58113
26. 26.837 26.837 ↑ 1.0 90,498 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_2 (cost=0.00..4,787.46 rows=92,250 width=60) (actual time=0.010..26.837 rows=90,498 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: 96739
  • Buffers: shared hit=2451
27. 173.956 494.968 ↓ 1.0 506,986 1

Hash (cost=65,179.13..65,179.13 rows=506,565 width=32) (actual time=494.968..494.968 rows=506,986 loops=1)

  • Output: contacts_2.id, contacts_2.brand
  • Buckets: 524288 Batches: 1 Memory Usage: 35189kB
  • Buffers: shared hit=55662
28. 321.012 321.012 ↓ 1.0 506,986 1

Seq Scan on public.contacts contacts_2 (cost=0.00..65,179.13 rows=506,565 width=32) (actual time=0.009..321.012 rows=506,986 loops=1)

  • Output: contacts_2.id, contacts_2.brand
  • Filter: ((contacts_2.deleted_at IS NULL) AND (contacts_2.id IS NOT NULL))
  • Rows Removed by Filter: 444842
  • Buffers: shared hit=55662
29. 0.966 2.597 ↑ 1.0 4,880 1

Hash (cost=855.80..855.80 rows=4,880 width=32) (actual time=2.597..2.597 rows=4,880 loops=1)

  • Output: email_campaigns_2.id, email_campaigns_2.brand
  • Buckets: 8192 Batches: 1 Memory Usage: 369kB
  • Buffers: shared hit=807
30. 1.631 1.631 ↑ 1.0 4,880 1

Seq Scan on public.email_campaigns email_campaigns_2 (cost=0.00..855.80 rows=4,880 width=32) (actual time=0.007..1.631 rows=4,880 loops=1)

  • Output: email_campaigns_2.id, email_campaigns_2.brand
  • Buffers: shared hit=807
31. 38.275 303.437 ↑ 1.0 216,784 1

Nested Loop (cost=0.70..11,982.42 rows=222,025 width=84) (actual time=0.039..303.437 rows=216,784 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=115190
32. 0.216 20.976 ↑ 1.0 166 1

Nested Loop (cost=0.28..5,031.46 rows=168 width=36) (actual time=0.020..20.976 rows=166 loops=1)

  • Output: email_campaigns_3.id, email_campaigns_3.brand, email_campaigns_recipients_3.send_type
  • Inner Unique: true
  • Buffers: shared hit=2950
33. 20.096 20.096 ↑ 1.0 166 1

Seq Scan on public.email_campaigns_recipients email_campaigns_recipients_3 (cost=0.00..4,787.46 rows=168 width=20) (actual time=0.009..20.096 rows=166 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: 187071
  • Buffers: shared hit=2451
34. 0.664 0.664 ↑ 1.0 1 166

Index Scan using email_campaigns_pkey on public.email_campaigns email_campaigns_3 (cost=0.28..1.45 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=166)

  • 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=499
35. 244.186 244.186 ↓ 3.6 1,306 166

Index Scan using contacts_brand_idx on public.contacts contacts_3 (cost=0.42..37.79 rows=358 width=82) (actual time=0.031..1.471 rows=1,306 loops=166)

  • 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 (length(contacts_3.email[1]) > 0))
  • Rows Removed by Filter: 381
  • Buffers: shared hit=112240
36. 51.483 1,858.186 ↓ 1.0 28,243 1

Hash Join (cost=75,345.45..116,204.47 rows=28,035 width=81) (actual time=212.067..1,858.186 rows=28,243 loops=1)

  • Output: ec_2.id, u.email, c_2.id, NULL::uuid, ecr_1.send_type
  • Hash Cond: ((ba."user" = u.id) AND (ec_2.brand = c_2.brand))
  • Buffers: shared hit=1781306
37. 24.661 1,602.101 ↑ 1.7 212,353 1

Nested Loop (cost=0.53..12,339.61 rows=355,000 width=52) (actual time=7.394..1,602.101 rows=212,353 loops=1)

  • Output: ec_2.id, ec_2.brand, ecr_1.send_type, ba."user
  • Buffers: shared hit=1547764
38. 0.521 21.664 ↑ 1.2 288 1

Nested Loop (cost=0.28..5,239.36 rows=355 width=52) (actual time=0.022..21.664 rows=288 loops=1)

  • Output: ec_2.id, ec_2.brand, ecr_1.send_type, ecr_1.brand
  • Inner Unique: true
  • Buffers: shared hit=3317
39. 20.279 20.279 ↑ 1.2 288 1

Seq Scan on public.email_campaigns_recipients ecr_1 (cost=0.00..4,787.46 rows=355 width=36) (actual time=0.013..20.279 rows=288 loops=1)

  • 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
  • Filter: ((ecr_1.deleted_at IS NULL) AND (ecr_1.recipient_type = 'Brand'::email_campaign_recipient_type))
  • Rows Removed by Filter: 186949
  • Buffers: shared hit=2451
40. 0.864 0.864 ↑ 1.0 1 288

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

  • 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.id = ecr_1.campaign)
  • Buffers: shared hit=866
41. 1,555.776 1,555.776 ↑ 1.4 737 288

Function Scan on public.get_brand_agents ba (cost=0.25..10.25 rows=1,000 width=16) (actual time=5.359..5.402 rows=737 loops=288)

  • 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)
  • Buffers: shared hit=1544447
42. 10.343 204.602 ↑ 1.2 25,946 1

Hash (cost=74,883.89..74,883.89 rows=30,735 width=93) (actual time=204.602..204.602 rows=25,946 loops=1)

  • Output: u.email, u.id, cu."user", c_2.id, c_2.brand
  • Buckets: 32768 Batches: 1 Memory Usage: 3346kB
  • Buffers: shared hit=233542
43. 11.433 194.259 ↓ 1.3 38,660 1

Hash Join (cost=2,246.62..74,883.89 rows=30,735 width=93) (actual time=3.417..194.259 rows=38,660 loops=1)

  • Output: u.email, u.id, cu."user", c_2.id, c_2.brand
  • Inner Unique: true
  • Hash Cond: (cu."user" = u.id)
  • Buffers: shared hit=233542
44. 1.892 179.442 ↓ 1.3 38,660 1

Nested Loop (cost=0.42..72,556.97 rows=30,735 width=48) (actual time=0.023..179.442 rows=38,660 loops=1)

  • Output: cu."user", c_2.id, c_2.brand
  • Inner Unique: true
  • Buffers: shared hit=231456
45. 4.498 4.498 ↑ 1.0 57,684 1

Seq Scan on public.contacts_users cu (cost=0.00..1,003.43 rows=57,743 width=32) (actual time=0.006..4.498 rows=57,684 loops=1)

  • Output: cu.contact, cu."user
  • Buffers: shared hit=426
46. 173.052 173.052 ↑ 1.0 1 57,684

Index Scan using contacts_pkey on public.contacts c_2 (cost=0.42..1.24 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=57,684)

  • Output: c_2.id, c_2.brand
  • Index Cond: ((c_2.id = cu.contact) AND (c_2.id IS NOT NULL))
  • Filter: (c_2.deleted_at IS NULL)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=231030
47. 1.042 3.384 ↑ 1.0 7,120 1

Hash (cost=2,157.20..2,157.20 rows=7,120 width=45) (actual time=3.384..3.384 rows=7,120 loops=1)

  • Output: u.email, u.id
  • Buckets: 8192 Batches: 1 Memory Usage: 603kB
  • Buffers: shared hit=2086
48. 2.342 2.342 ↑ 1.0 7,120 1

Seq Scan on public.users u (cost=0.00..2,157.20 rows=7,120 width=45) (actual time=0.003..2.342 rows=7,120 loops=1)

  • Output: u.email, u.id
  • Buffers: shared hit=2086
49. 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
50. 0.017 1.715 ↑ 1.6 86 1

Hash (cost=855.80..855.80 rows=141 width=32) (actual time=1.714..1.715 rows=86 loops=1)

  • Output: ec.id, ec.brand
  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
  • Buffers: shared hit=807
51. 1.698 1.698 ↑ 1.6 86 1

Seq Scan on public.email_campaigns ec (cost=0.00..855.80 rows=141 width=32) (actual time=0.342..1.698 rows=86 loops=1)

  • Output: ec.id, ec.brand
  • Filter: ((ec.deleted_at IS NULL) AND (ec.executed_at IS NULL) AND (ec.due_at IS NOT NULL))
  • Rows Removed by Filter: 4794
  • Buffers: shared hit=807
52. 0.003 0.021 ↑ 1.0 1 1

Hash (cost=2.64..2.64 rows=1 width=66) (actual time=0.021..0.021 rows=1 loops=1)

  • Output: c.brand, c.email
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=4
53. 0.018 0.018 ↑ 1.0 1 1

Index Scan using contacts_pkey on public.contacts c (cost=0.42..2.64 rows=1 width=66) (actual time=0.017..0.018 rows=1 loops=1)

  • Output: c.brand, c.email
  • Index Cond: (c.id = 'dfcbaa08-f3a5-46c6-9331-97162b7daf79'::uuid)
  • Filter: (c.deleted_at IS NULL)
  • Buffers: shared hit=4
Planning time : 6.065 ms
Execution time : 7,112.411 ms