explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bABx

Settings
# exclusive inclusive rows x rows loops node
1. 0.123 25.185 ↑ 1.0 100 1

Limit (cost=1,233.35..44,420.59 rows=100 width=2,426) (actual time=0.560..25.185 rows=100 loops=1)

  • Output: c.id, cpi.given_name, cpi.preferred_name, cpi.other_given_names, cpi.family_name, cpi.name_suffix, c.school_code, c.record_type, (CASE WHEN (c.record_type = 'Company'::community_record_type) THEN (c.company_name)::text ELSE concat(CASE WHEN ((CO
  • Buffers: shared hit=15,768
2. 15.659 25.062 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,233.35..45,755,955.68 rows=105,945 width=2,426) (actual time=0.558..25.062 rows=100 loops=1)

  • Output: c.id, cpi.given_name, cpi.preferred_name, cpi.other_given_names, cpi.family_name, cpi.name_suffix, c.school_code, c.record_type, CASE WHEN (c.record_type = 'Company'::community_record_type) THEN (c.company_name)::text ELSE concat(CASE WHEN
  • Inner Unique: true
  • Buffers: shared hit=15,768
3. 0.352 9.403 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,232.80..7,230,212.66 rows=105,945 width=780) (actual time=0.273..9.403 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferred_name, cpi.other_given_names, cpi.f
  • Inner Unique: true
  • Buffers: shared hit=7,895
4. 0.361 9.051 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,232.24..6,777,287.24 rows=105,945 width=768) (actual time=0.267..9.051 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferred_name, cpi.other_given_names,
  • Inner Unique: true
  • Buffers: shared hit=7,491
5. 0.374 8.690 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,231.69..6,324,361.81 rows=105,945 width=756) (actual time=0.257..8.690 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferred_name, cpi.other_given_
  • Inner Unique: true
  • Buffers: shared hit=7,087
6. 0.173 8.316 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,231.13..5,871,436.38 rows=105,945 width=744) (actual time=0.250..8.316 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferred_name, cpi.other_
  • Inner Unique: true
  • Buffers: shared hit=6,683
7. 0.172 7.943 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,230.58..5,418,510.95 rows=105,945 width=732) (actual time=0.241..7.943 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferred_name, cpi.
  • Inner Unique: true
  • Buffers: shared hit=6,279
8. 0.127 7.571 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,230.02..4,965,585.52 rows=105,945 width=720) (actual time=0.234..7.571 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferred_name
  • Inner Unique: true
  • Buffers: shared hit=5,875
9. 0.157 7.144 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,229.47..4,512,660.09 rows=105,945 width=708) (actual time=0.223..7.144 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.preferre
  • Inner Unique: true
  • Join Filter: (lut.tenant_id = c.tenant_id)
  • Buffers: shared hit=5,471
10. 0.144 6.987 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,229.04..4,217,542.81 rows=105,945 width=664) (actual time=0.219..6.987 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name, cpi.pr
  • Join Filter: (lut.tenant_id = c.tenant_id)
  • Buffers: shared hit=5,471
11. 0.157 6.643 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,228.62..3,862,063.83 rows=105,945 width=648) (actual time=0.213..6.643 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_name,
  • Inner Unique: true
  • Join Filter: (lut.tenant_id = c.tenant_id)
  • Rows Removed by Join Filter: 98
  • Buffers: shared hit=5,068
12. 0.890 5.986 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,228.20..3,621,269.30 rows=105,945 width=588) (actual time=0.201..5.986 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.given_
  • Inner Unique: true
  • Buffers: shared hit=4,667
13. 0.143 4.696 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,215.31..2,040,813.69 rows=105,945 width=572) (actual time=0.177..4.696 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname, cpi.
  • Inner Unique: true
  • Buffers: shared hit=3,863
14. 0.147 4.553 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,215.02..1,827,036.20 rows=105,945 width=572) (actual time=0.173..4.553 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.sortname
  • Inner Unique: true
  • Buffers: shared hit=3,863
15. 0.150 4.406 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,214.60..1,578,589.10 rows=105,945 width=527) (actual time=0.169..4.406 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention, c.so
  • Inner Unique: true
  • Buffers: shared hit=3,863
16. 0.061 4.256 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1,214.17..1,305,616.99 rows=105,945 width=480) (actual time=0.165..4.256 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_attention
  • Join Filter: ((cpdefault.tenant_id = c.tenant_id) AND (cpdefault.community_id = c.id))
  • Buffers: shared hit=3,863
17. 0.692 4.095 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=607.93..1,303,156.67 rows=105,945 width=469) (actual time=0.114..4.095 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.company_att
  • Inner Unique: true
  • Buffers: shared hit=3,853
  • -> Index Scan using community_display_name_community_id_display_type_uk on public.community_display_name cdn6 (cost=0.56..4.28 rows=1 width=44) (actual tim
18. 0.083 3.403 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=607.38..850,231.24 rows=105,945 width=457) (actual time=0.097..3.403 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c.compa
  • Join Filter: ((cpdefaultsms.tenant_id = c.tenant_id) AND (cpdefaultsms.community_id = c.id))
  • Buffers: shared hit=3,449
  • Output: cdn6.tenant_id, cdn6.created_id, cdn6.created, cdn6.modified_id, cdn6.modified, cdn6.id, cdn6.community_id, cdn6.display_type, cdn6.display_nam
  • Index Cond: ((cdn6.tenant_id = c.tenant_id) AND (cdn6.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid) AND (cdn6.community_id = c.id) AND ((cd
  • Buffers: shared hit=404
19. 0.142 3.220 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=1.14..847,770.92 rows=105,945 width=446) (actual time=0.038..3.220 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_description, c
  • Inner Unique: true
  • Join Filter: (lut.tenant_id = c.tenant_id)
  • Buffers: shared hit=3,439
20. 2.878 2.878 ↑ 1,059.5 100 1

Nested Loop Left Join (cost=0.84..630,539.64 rows=105,945 width=430) (actual time=0.034..2.878 rows=100 loops=1)

  • Output: c.id, c.school_code, c.record_type, c.company_name, c.tenant_id, c.spouse_community_id, c.occupation_company, c.occupation_descript
  • Inner Unique: true
  • Filter: (((COALESCE(cpi.family_name, ''::character varying))::text <> 'TEST_ENV'::text) AND ((COALESCE(cpi.given_name, ''::character varyin
  • Buffers: shared hit=3,145
  • -> Index Scan using community_sortname_idx on public.community c (cost=0.42..377450.12 rows=107,012 width=140) (actual time=0.018..2.214 r
  • Output: c.id, c.tenant_id, c.company_name, c.record_type, c.school_code, c.created, c.created_id, c.modified, c.modified_id, c.postal
  • Filter: (c.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid)
  • Rows Removed by Filter: 2,670
  • Buffers: shared hit=2,744
  • -> Index Scan using individual_pkey on public.community_personal_info cpi (cost=0.42..2.35 rows=1 width=322) (actual time=0.005..0.005 ro
  • Output: cpi.given_name, cpi.preferred_name, cpi.other_given_names, cpi.family_name, cpi.name_suffix, cpi.deceased, cpi.lookup_gender_
  • Index Cond: (cpi.community_id = c.id)
  • Filter: ((cpi.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid) AND (cpi.tenant_id = c.tenant_id))
  • Buffers: shared hit=401
21. 0.200 0.200 ↓ 0.0 0 100

Index Scan using lookup_title_pkey on public.lookup_title lut (cost=0.29..2.04 rows=1 width=48) (actual time=0.002..0.002 rows=0 loops=100)

  • Output: lut.id, lut.tenant_id, lut.code, lut.description, lut.lookup_gender_id, lut.active, lut.read_only, lut.sort_order, lut.created, lut
  • Index Cond: (lut.id = cpi.lookup_title_id)
  • Filter: (lut.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=294
22. 0.044 0.100 ↓ 0.0 0 100

Materialize (cost=606.24..606.29 rows=1 width=43) (actual time=0.001..0.001 rows=0 loops=100)

  • Output: cpdefaultsms.display_phone, cpdefaultsms.tenant_id, cpdefaultsms.community_id
  • Buffers: shared hit=10
23. 0.001 0.056 ↓ 0.0 0 1

Subquery Scan on cpdefaultsms (cost=606.24..606.28 rows=1 width=43) (actual time=0.055..0.056 rows=0 loops=1)

  • Output: cpdefaultsms.display_phone, cpdefaultsms.tenant_id, cpdefaultsms.community_id
  • Filter: (cpdefaultsms.rownum = 1)
  • Buffers: shared hit=10
24. 0.002 0.055 ↓ 0.0 0 1

WindowAgg (cost=606.24..606.27 rows=1 width=203) (actual time=0.055..0.055 rows=0 loops=1)

  • Output: NULL::uuid, cpdefaultsmssq.tenant_id, cpdefaultsmssq.community_id, NULL::boolean, NULL::boolean, NULL::boolean, cpdefaultsmss
  • Buffers: shared hit=10
25. 0.053 0.053 ↓ 0.0 0 1

Sort (cost=606.24..606.25 rows=1 width=52) (actual time=0.053..0.053 rows=0 loops=1)

  • Output: cpdefaultsmssq.tenant_id, cpdefaultsmssq.community_id, cpdefaultsmssq.default_sms, cpdefaultsmssq.created, cpdefaultsms
  • Sort Key: cpdefaultsmssq.community_id, cpdefaultsmssq.default_sms, cpdefaultsmssq.created DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
  • -> Bitmap Heap Scan on public.community_phone cpdefaultsmssq (cost=9.82..606.23 rows=1 width=52) (actual time=0.045..0.045 ro
  • Output: cpdefaultsmssq.tenant_id, cpdefaultsmssq.community_id, cpdefaultsmssq.default_sms, cpdefaultsmssq.created, cpdefa
  • Recheck Cond: (cpdefaultsmssq.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid)
  • Filter: cpdefaultsmssq.default_sms
  • Rows Removed by Filter: 129
  • Heap Blocks: exact=6
  • Buffers: shared hit=10
  • -> Bitmap Index Scan on community_phone_ix_community_id_tenant_id (cost=0.00..9.82 rows=187 width=0) (actual time=0.017
  • Index Cond: (cpdefaultsmssq.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid)
  • Buffers: shared hit=4
26. 0.052 0.100 ↓ 0.0 0 100

Materialize (cost=606.24..606.29 rows=1 width=43) (actual time=0.001..0.001 rows=0 loops=100)

  • Output: cpdefault.display_phone, cpdefault.tenant_id, cpdefault.community_id
  • Buffers: shared hit=10
27. 0.000 0.048 ↓ 0.0 0 1

Subquery Scan on cpdefault (cost=606.24..606.28 rows=1 width=43) (actual time=0.048..0.048 rows=0 loops=1)

  • Output: cpdefault.display_phone, cpdefault.tenant_id, cpdefault.community_id
  • Filter: (cpdefault.rownum = 1)
  • Buffers: shared hit=10
28. 0.001 0.048 ↓ 0.0 0 1

WindowAgg (cost=606.24..606.27 rows=1 width=203) (actual time=0.047..0.048 rows=0 loops=1)

  • Output: NULL::uuid, cpdefaultsq.tenant_id, cpdefaultsq.community_id, NULL::boolean, NULL::boolean, cpdefaultsq."default", NULL::boolean, cpdefaul
  • Buffers: shared hit=10
29. 0.005 0.047 ↓ 0.0 0 1

Sort (cost=606.24..606.25 rows=1 width=52) (actual time=0.046..0.047 rows=0 loops=1)

  • Output: cpdefaultsq.tenant_id, cpdefaultsq.community_id, cpdefaultsq."default", cpdefaultsq.created, cpdefaultsq.display_phone
  • Sort Key: cpdefaultsq.community_id, cpdefaultsq."default", cpdefaultsq.created DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
30. 0.042 0.042 ↓ 0.0 0 1

Bitmap Heap Scan on public.community_phone cpdefaultsq (cost=9.82..606.23 rows=1 width=52) (actual time=0.042..0.042 rows=0 loops=1)

  • Output: cpdefaultsq.tenant_id, cpdefaultsq.community_id, cpdefaultsq."default", cpdefaultsq.created, cpdefaultsq.display_phone
  • Recheck Cond: (cpdefaultsq.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid)
  • Filter: cpdefaultsq."default
  • Rows Removed by Filter: 129
  • Heap Blocks: exact=6
  • Buffers: shared hit=10
  • -> Bitmap Index Scan on community_phone_ix_community_id_tenant_id (cost=0.00..9.82 rows=187 width=0) (actual time=0.010..0.011 rows
  • Index Cond: (cpdefaultsq.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid)
  • Buffers: shared hit=4
31. 0.000 0.000 ↓ 0.0 0 100

Index Scan using community_pkey on public.community cspouse (cost=0.42..2.58 rows=1 width=47) (actual time=0.000..0.000 rows=0 loops=100)

  • Output: cspouse.id, cspouse.tenant_id, cspouse.company_name, cspouse.record_type, cspouse.school_code, cspouse.created, cspouse.created_id, cspouse.modified, cspou
  • Index Cond: (cspouse.id = c.spouse_community_id)
32. 0.000 0.000 ↓ 0.0 0 100

Index Scan using individual_pkey on public.community_personal_info cpispouse (cost=0.42..2.35 rows=1 width=61) (actual time=0.000..0.000 rows=0 loops=100)

  • Output: cpispouse.given_name, cpispouse.family_name, cpispouse.preferred_name, cpispouse.community_id, cpispouse.lookup_title_id
  • Index Cond: (cpispouse.community_id = c.spouse_community_id)
33. 0.000 0.000 ↓ 0.0 0 100

Index Scan using lookup_title_pkey on public.lookup_title lutspouse (cost=0.29..2.02 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=100)

  • Output: lutspouse.id, lutspouse.tenant_id, lutspouse.code, lutspouse.description, lutspouse.lookup_gender_id, lutspouse.active, lutspouse.read_only, lutspouse.sort_order, luts
  • Index Cond: (lutspouse.id = cpispouse.lookup_title_id)
34. 0.000 0.400 ↑ 1.0 1 100

Index Scan using community_address_pkey on public.community_address cahome (cost=12.89..14.92 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=100)

  • Output: cahome.id, cahome.tenant_id, cahome.community_id, cahome.address_id, cahome.active, cahome.created, cahome.created_id, cahome.modified, cahome.modified_id, cahome.lookup_add
  • Index Cond: (cahome.id = (SubPlan 32))
  • Buffers: shared hit=403
35.          

SubPlan (for Index Scan)

36. 0.100 0.600 ↑ 1.0 1 100

Limit (cost=0.42..12.47 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=100)

  • Output: tmpca.id
  • Buffers: shared hit=401
37. 0.500 0.500 ↑ 1.0 1 100

Index Scan using community_address_ix_community_id on public.community_address tmpca (cost=0.42..12.47 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=100)

  • Output: tmpca.id
  • Index Cond: (tmpca.community_id = c.id)
  • Filter: ((tmpca.system_meaning = 'home'::lookup_address_type_system_meaning) AND (tmpca.tenant_id = c.tenant_id))
  • Buffers: shared hit=401
38. 0.500 0.500 ↑ 1.0 1 100

Index Scan using address_pkey on public.address ahome (cost=0.42..2.26 rows=1 width=92) (actual time=0.005..0.005 rows=1 loops=100)

  • Output: ahome.confidential_address, ahome.line_1, ahome.line_2, ahome.line_3, ahome.suburb, ahome.postcode, ahome.lookup_country_id, ahome.lookup_state_id, ahome.id
  • Index Cond: (cahome.address_id = ahome.id)
  • Buffers: shared hit=401
39. 0.200 0.200 ↓ 0.0 0 100

Index Scan using community_address_ix_community_id on public.community_address capostal (cost=0.42..3.34 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=100)

  • Output: capostal.id, capostal.tenant_id, capostal.community_id, capostal.address_id, capostal.active, capostal.created, capostal.created_id, capostal.modified, capostal.modified_id, capostal.lo
  • Index Cond: (capostal.community_id = c.id)
  • Filter: (capostal.system_meaning = 'postal'::lookup_address_type_system_meaning)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=403
40. 0.000 0.000 ↓ 0.0 0 100

Index Scan using address_pkey on public.address apostal (cost=0.42..2.77 rows=1 width=92) (actual time=0.000..0.000 rows=0 loops=100)

  • Output: apostal.confidential_address, apostal.line_1, apostal.line_2, apostal.line_3, apostal.suburb, apostal.postcode, apostal.lookup_country_id, apostal.lookup_state_id, apostal.id
  • Index Cond: (capostal.address_id = apostal.id)
41. 0.300 0.300 ↓ 0.0 0 100

Index Scan using community_display_name_community_id_display_type_uk on public.community_display_name cdn1 (cost=0.56..4.28 rows=1 width=44) (actual time=0.003..0.003 rows=0 loops=100)

  • Output: cdn1.tenant_id, cdn1.created_id, cdn1.created, cdn1.modified_id, cdn1.modified, cdn1.id, cdn1.community_id, cdn1.display_type, cdn1.display_name, cdn1.override, cdn1.override_display_name
  • Index Cond: ((cdn1.tenant_id = c.tenant_id) AND (cdn1.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid) AND (cdn1.community_id = c.id) AND ((cdn1.display_type)::text = 'mailNameJoiner'::text))
  • Buffers: shared hit=404
42. 0.200 0.200 ↓ 0.0 0 100

Index Scan using community_display_name_community_id_display_type_uk on public.community_display_name cdn2 (cost=0.56..4.28 rows=1 width=44) (actual time=0.002..0.002 rows=0 loops=100)

  • Output: cdn2.tenant_id, cdn2.created_id, cdn2.created, cdn2.modified_id, cdn2.modified, cdn2.id, cdn2.community_id, cdn2.display_type, cdn2.display_name, cdn2.override, cdn2.override_display_name
  • Index Cond: ((cdn2.tenant_id = c.tenant_id) AND (cdn2.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid) AND (cdn2.community_id = c.id) AND ((cdn2.display_type)::text = 'externalNameFormat'::text))
  • Buffers: shared hit=404
43. 0.200 0.200 ↓ 0.0 0 100

Index Scan using community_display_name_community_id_display_type_uk on public.community_display_name cdn3 (cost=0.56..4.28 rows=1 width=44) (actual time=0.002..0.002 rows=0 loops=100)

  • Output: cdn3.tenant_id, cdn3.created_id, cdn3.created, cdn3.modified_id, cdn3.modified, cdn3.id, cdn3.community_id, cdn3.display_type, cdn3.display_name, cdn3.override, cdn3.override_display_name
  • Index Cond: ((cdn3.tenant_id = c.tenant_id) AND (cdn3.tenant_id = 'd6cd45bb-7717-480d-b189-b789caad692b'::uuid) AND (cdn3.community_id = c.id) AND ((cdn3.display_type)::text = 'legalNameFormat'::text))