explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lwtX

Settings
# exclusive inclusive rows x rows loops node
1. 0.129 2,713.257 ↓ 15.0 30 1

Limit (cost=122.60..122.68 rows=2 width=1,038) (actual time=2,713.067..2,713.257 rows=30 loops=1)

2. 0.060 2,713.128 ↓ 15.0 30 1

Result (cost=122.60..122.68 rows=2 width=1,038) (actual time=2,713.065..2,713.128 rows=30 loops=1)

3. 0.782 2,713.068 ↓ 15.0 30 1

Sort (cost=122.60..122.61 rows=2 width=1,006) (actual time=2,713.056..2,713.068 rows=30 loops=1)

  • Sort Key: cne.priority DESC NULLS LAST, cne.overdue_business_days DESC
  • Sort Method: top-N heapsort Memory: 33kB
4. 1.806 2,712.286 ↓ 725.0 1,450 1

Unique (cost=122.39..122.57 rows=2 width=1,006) (actual time=2,709.887..2,712.286 rows=1,450 loops=1)

5. 2.434 2,710.480 ↓ 725.0 1,450 1

Sort (cost=122.39..122.40 rows=2 width=1,006) (actual time=2,709.886..2,710.480 rows=1,450 loops=1)

  • Sort Key: cne.id, cne.cid, ce.id, ca.leasing_agent_id, cne.priority, cne.overdue_business_days, cne.overdue_buisness_time, cne.primary_customer_id, (''::text), cne.name_first, cne.name_last, (COALESCE((((ce.name_first)::text || ' '::text) || (ce.name_last)::text), (ce.name_first)::text, (ce.name_last)::text)), cne.primary_phone_number, (''::text), cne.ps_product_id, cne.associated_event_id, cne.property_name, cne.data_reference_id, cne.lease_id, (NULL::integer), cne.created_on, cne.scheduled_datetime, (COALESCE(est.name, et.name)), cne.property_id, cne.notes, cne.event_sub_type_id, (2), ei.event_type_id, ((date_part('day'::text, (now() - ((ei.scheduled_datetime)::timestamp without time zone)::timestamp with time zone)))::integer), ((date_part('day'::text, (now() - ((ei_2.scheduled_datetime)::timestamp without time zone)::timestamp with time zone)))::integer), ((ei.scheduled_datetime)::timestamp without time zone), ei_2.event_type_id, ei_1.notes, tz.time_zone_name, (concat_ws(' - '::text, lst.name, lit.name))
  • Sort Method: quicksort Memory: 835kB
6. 1.117 2,708.046 ↓ 725.0 1,450 1

Append (cost=59.43..122.38 rows=2 width=1,006) (actual time=938.149..2,708.046 rows=1,450 loops=1)

7. 0.109 938.292 ↓ 83.0 83 1

Unique (cost=59.43..59.51 rows=1 width=750) (actual time=938.147..938.292 rows=83 loops=1)

8. 0.184 938.183 ↓ 83.0 83 1

Sort (cost=59.43..59.43 rows=1 width=750) (actual time=938.146..938.183 rows=83 loops=1)

  • Sort Key: cne.id, ce.id, ca.leasing_agent_id, cne.priority, cne.overdue_business_days, cne.overdue_buisness_time, cne.primary_customer_id, cne.name_first, cne.name_last, (COALESCE((((ce.name_first)::text || ' '::text) || (ce.name_last)::text), (ce.name_first)::text, (ce.name_last)::text)), cne.primary_phone_number, cne.ps_product_id, cne.associated_event_id, cne.property_name, cne.data_reference_id, cne.lease_id, cne.created_on, cne.scheduled_datetime, (COALESCE(est.name, et.name)), cne.property_id, cne.notes, cne.event_sub_type_id, ei.event_type_id, ((date_part('day'::text, (now() - ((ei.scheduled_datetime)::timestamp without time zone)::timestamp with time zone)))::integer), ((date_part('day'::text, (now() - ((ei_2.scheduled_datetime)::timestamp without time zone)::timestamp with time zone)))::integer), ((ei.scheduled_datetime)::timestamp without time zone), ei_2.event_type_id, ei_1.notes, tz.time_zone_name, (concat_ws(' - '::text, lst.name, lit.name))
  • Sort Method: quicksort Memory: 48kB
9. 0.299 937.999 ↓ 83.0 83 1

Nested Loop Left Join (cost=46.44..59.42 rows=1 width=750) (actual time=925.024..937.999 rows=83 loops=1)

10. 0.120 931.060 ↓ 83.0 83 1

Nested Loop Left Join (cost=36.48..49.39 rows=1 width=782) (actual time=924.813..931.060 rows=83 loops=1)

11. 0.133 930.193 ↓ 83.0 83 1

Nested Loop Left Join (cost=32.18..45.07 rows=1 width=729) (actual time=924.784..930.193 rows=83 loops=1)

12. 0.116 927.653 ↓ 83.0 83 1

Nested Loop Left Join (cost=19.68..32.54 rows=1 width=717) (actual time=924.661..927.653 rows=83 loops=1)

13. 0.256 927.454 ↓ 83.0 83 1

Nested Loop Left Join (cost=19.39..32.20 rows=1 width=704) (actual time=924.651..927.454 rows=83 loops=1)

  • Filter: CASE WHEN (ca.mute_followups_until IS NOT NULL) THEN (CURRENT_DATE >= ca.mute_followups_until) ELSE true END
14. 0.123 926.866 ↓ 83.0 83 1

Nested Loop Left Join (cost=18.96..29.53 rows=1 width=700) (actual time=924.636..926.866 rows=83 loops=1)

15. 0.160 926.577 ↓ 83.0 83 1

Nested Loop Left Join (cost=18.83..29.37 rows=1 width=586) (actual time=924.632..926.577 rows=83 loops=1)

16. 0.134 926.002 ↓ 83.0 83 1

Nested Loop Left Join (cost=18.40..26.71 rows=1 width=586) (actual time=924.616..926.002 rows=83 loops=1)

17. 0.144 925.702 ↓ 83.0 83 1

Nested Loop (cost=18.26..24.32 rows=1 width=562) (actual time=924.608..925.702 rows=83 loops=1)

18. 0.130 925.392 ↓ 83.0 83 1

Nested Loop (cost=18.11..21.94 rows=1 width=545) (actual time=924.599..925.392 rows=83 loops=1)

19. 0.167 925.096 ↓ 83.0 83 1

Nested Loop (cost=17.98..21.54 rows=1 width=331) (actual time=924.591..925.096 rows=83 loops=1)

20. 0.110 924.680 ↓ 83.0 83 1

Hash Right Join (cost=17.69..18.77 rows=1 width=327) (actual time=924.580..924.680 rows=83 loops=1)

  • Hash Cond: (lit.id = cne.lease_interval_type_id)
21. 0.012 0.012 ↑ 1.0 5 1

Seq Scan on lease_interval_types lit (cost=0.00..1.05 rows=5 width=122) (actual time=0.007..0.012 rows=5 loops=1)

22. 0.067 924.558 ↓ 83.0 83 1

Hash (cost=17.67..17.67 rows=1 width=213) (actual time=924.557..924.558 rows=83 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
23. 0.090 924.491 ↓ 83.0 83 1

Subquery Scan on cne (cost=17.54..17.67 rows=1 width=213) (actual time=924.266..924.491 rows=83 loops=1)

24. 0.101 924.401 ↓ 83.0 83 1

Unique (cost=17.54..17.66 rows=1 width=580) (actual time=924.263..924.401 rows=83 loops=1)

25. 0.275 924.300 ↓ 83.0 83 1

Sort (cost=17.54..17.54 rows=1 width=580) (actual time=924.261..924.300 rows=83 loops=1)

  • Sort Key: e.id, e.property_id, e.property_unit_id, e.unit_space_id, e.event_type_id, e.event_sub_type_id, e.event_result_id, e.default_event_result_id, e.associated_event_id, e.ps_product_id, e.old_stage_id, e.new_stage_id, e.old_status_id, e.new_status_id, e.company_employee_id, e.data_reference_id, e.integration_result_id, e.lease_id, e.lease_interval_id, e.customer_id, e.scheduled_task_id, e.remote_primary_key, e.calendar_event_key, e.scheduled_datetime, e.scheduled_end_datetime, e.event_datetime, e.event_handle, e.title, e.notes, e.details, e.ip_address, e.do_not_export, e.is_resident, e.is_deleted, e.updated_by, e.updated_on, e.created_by, e.created_on, (CASE WHEN (e.details ? 'overdue_on'::text) THEN CASE WHEN ((now())::timestamp without time zone > (btrim(((e.details)::json ->> 'overdue_on'::text)))::timestamp without time zone) THEN 3 WHEN (COALESCE((CURRENT_DATE - (((e.details)::json ->> 'overdue_on'::text))::date), 0) = 0) THEN 2 ELSE 1 END ELSE CASE WHEN ((now())::timestamp without time zone > (e.scheduled_datetime)::timestamp without time zone) THEN 3 WHEN (COALESCE((CURRENT_DATE - (e.scheduled_datetime)::date), 0) = 0) THEN 2 ELSE 1 END END), (CASE WHEN (e.details ? 'overdue_on'::text) THEN abs(COALESCE((CURRENT_DATE - (((e.details)::json ->> 'overdue_on'::text))::date), 0)) ELSE abs(COALESCE((CURRENT_DATE - (e.scheduled_datetime)::date), 0)) END), (CASE WHEN (e.details ? 'overdue_on'::text) THEN to_char((((((e.details)::json ->> 'overdue_on'::text))::timestamp without time zone)::time without time zone)::interval, 'HH12:MIam'::text) ELSE to_char(((e.scheduled_datetime)::time without time zone)::interval, 'HH12:MIam'::text) END), ((((e.details -> 'auto_creation'::text) ->> 'triggering_event_id'::text))::integer), (COALESCE((date_part('day'::text, (btrim(((e.details)::json ->> 'overdue_on'::text)))::timestamp without time zone) - date_part('day'::text, (now())::timestamp without time zone)), '0'::double precision)), cl.name_first, cl.name_last, cl.property_name, cl.primary_phone_number, cl.lease_interval_type_id, cl.primary_customer_id
  • Sort Method: quicksort Memory: 68kB
26. 1.296 924.025 ↓ 83.0 83 1

Nested Loop Anti Join (cost=1.39..17.53 rows=1 width=580) (actual time=52.168..924.025 rows=83 loops=1)

27. 7.247 922.646 ↓ 83.0 83 1

Nested Loop (cost=1.11..16.91 rows=1 width=524) (actual time=52.133..922.646 rows=83 loops=1)

  • Join Filter: (lp.property_id = e.property_id)
28. 12.339 34.799 ↓ 12,580.0 12,580 1

Nested Loop (cost=0.67..3.54 rows=1 width=76) (actual time=3.277..34.799 rows=12,580 loops=1)

29. 3.285 3.285 ↓ 25.0 25 1

Function Scan on load_properties lp (cost=0.25..0.88 rows=1 width=4) (actual time=3.261..3.285 rows=25 loops=1)

  • Filter: (is_disabled = 0)
30. 19.175 19.175 ↓ 503.0 503 25

Index Scan using idx_cached_leases_cid_property_id on cached_leases cl (cost=0.42..2.66 rows=1 width=72) (actual time=0.011..0.767 rows=503 loops=25)

  • Index Cond: ((cid = 13576) AND (property_id = lp.property_id))
  • Filter: (((lease_status_type_id = ANY ('{3,4,5}'::integer[])) OR (lease_status_type_id = 1)) AND (occupancy_type_id = ANY ('{1,2,3,4,6,9,10,11}'::integer[])))
  • Rows Removed by Filter: 278
31. 880.600 880.600 ↓ 0.0 0 12,580

Index Scan using idx_events_lease_id on events e (cost=0.43..13.36 rows=1 width=464) (actual time=0.069..0.070 rows=0 loops=12,580)

  • Index Cond: ((cid = 13576) AND (lease_id = cl.id) AND (lease_id IS NOT NULL))
  • Filter: ((NOT is_deleted) AND (event_result_id IS NULL) AND (cl.property_id = property_id) AND (((event_type_id = 316) AND (event_sub_type_id IS NULL)) OR (event_sub_type_id <> ALL ('{20,85}'::integer[]))) AND (CURRENT_DATE >= (scheduled_datetime)::date) AND ((cl.lease_status_type_id = ANY ('{3,4,5}'::integer[])) OR (((cl.lease_interval_type_id = 5) OR (event_type_id = 316)) AND (cl.lease_status_type_id = 1))) AND ((event_sub_type_id = ANY ('{2,17,18,19,5,7,20,21,85,1,130}'::integer[])) OR ((event_type_id = 1) AND (ps_product_id = 28) AND is_resident) OR ((ps_product_id = 28) AND (event_sub_type_id = ANY ('{23,9,10,11,111,112,113,114,115,70,136,135,68,69}'::integer[]))) OR ((event_type_id = 316) AND (event_sub_type_id IS NULL))))
  • Rows Removed by Filter: 66
32. 0.083 0.083 ↓ 0.0 0 83

Index Scan using idx_event_results on event_results er (cost=0.28..0.44 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=83)

  • Index Cond: (id = e.event_result_id)
  • Filter: (is_system AND (cid = 13576) AND (cid = e.cid) AND ((2 = ANY (default_event_result_ids)) OR (4 = ANY (default_event_result_ids)) OR (65 = ANY (default_event_result_ids))))
33. 0.249 0.249 ↑ 1.0 1 83

Index Scan using idx_properties_id on properties p (cost=0.29..2.51 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=83)

  • Index Cond: (id = cne.property_id)
  • Filter: (cid = 13576)
34. 0.166 0.166 ↑ 1.0 1 83

Index Scan using pk_time_zones on time_zones tz (cost=0.14..0.36 rows=1 width=222) (actual time=0.002..0.002 rows=1 loops=83)

  • Index Cond: (id = p.time_zone_id)
35. 0.166 0.166 ↑ 1.0 1 83

Index Scan using pk_event_types on event_types et (cost=0.15..2.37 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=83)

  • Index Cond: (id = cne.event_type_id)
36. 0.166 0.166 ↑ 1.0 1 83

Index Scan using pk_event_sub_types on event_sub_types est (cost=0.14..2.36 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=83)

  • Index Cond: (id = cne.event_sub_type_id)
37. 0.415 0.415 ↑ 1.0 1 83

Index Scan using idx_lease_customers_cid_lease_id_customer_id_lease_status_type_ on lease_customers lcs (cost=0.42..2.65 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=83)

  • Index Cond: ((cid = cne.cid) AND (cid = 13576) AND (lease_id = cne.lease_id) AND (customer_id = cne.customer_id))
  • Filter: (property_id = cne.property_id)
38. 0.166 0.166 ↑ 1.0 1 83

Index Scan using pk_lease_status_types on lease_status_types lst (cost=0.13..0.15 rows=1 width=122) (actual time=0.002..0.002 rows=1 loops=83)

  • Index Cond: (lcs.lease_status_type_id = id)
39. 0.332 0.332 ↑ 1.0 1 83

Index Scan using idx_cached_applications_lease_interval_id on cached_applications ca (cost=0.42..2.65 rows=1 width=24) (actual time=0.003..0.004 rows=1 loops=83)

  • Index Cond: (lease_interval_id = cne.lease_interval_id)
  • Filter: ((cid = 13576) AND (cne.cid = cid) AND (cne.cached_lease_id = lease_id) AND (property_id = cne.property_id))
40. 0.083 0.083 ↓ 0.0 0 83

Index Scan using idx_company_employees_id on company_employees ce (cost=0.29..0.33 rows=1 width=21) (actual time=0.001..0.001 rows=0 loops=83)

  • Index Cond: (id = ca.leasing_agent_id)
  • Filter: ((cid = 13576) AND (cid = ca.cid))
41. 0.166 2.407 ↓ 0.0 0 83

Limit (cost=12.50..12.51 rows=1 width=16) (actual time=0.028..0.029 rows=0 loops=83)

42. 0.249 2.241 ↓ 0.0 0 83

Sort (cost=12.50..12.51 rows=1 width=16) (actual time=0.027..0.027 rows=0 loops=83)

  • Sort Key: ei.scheduled_datetime DESC, ei.id DESC
  • Sort Method: quicksort Memory: 25kB
43. 0.043 1.992 ↓ 0.0 0 83

Nested Loop Left Join (cost=1.83..12.49 rows=1 width=16) (actual time=0.021..0.024 rows=0 loops=83)

  • Filter: CASE WHEN (pp2.id IS NOT NULL) THEN (COALESCE(ei.ps_product_id, 0) <> 28) ELSE true END
44. 0.116 1.909 ↓ 0.0 0 83

Nested Loop Left Join (cost=1.27..9.69 rows=1 width=28) (actual time=0.020..0.023 rows=0 loops=83)

  • Filter: CASE WHEN (pp1.id IS NOT NULL) THEN (COALESCE(ei.ps_product_id, 0) <> 46) ELSE true END
45. 0.225 1.743 ↓ 0.0 0 83

Nested Loop Left Join (cost=0.71..6.89 rows=1 width=28) (actual time=0.019..0.021 rows=0 loops=83)

  • Filter: CASE WHEN ((ei.event_type_id = 15) AND (ei.event_sub_type_id = 2)) THEN ((1 = ANY (er_1.default_event_result_ids)) OR (2 = ANY (er_1.default_event_result_ids)) OR (3 = ANY (er_1.default_event_result_ids))) WHEN (ei.event_type_id = ANY ('{1,17,173}'::integer[])) THEN true WHEN ((ei.event_type_id = 3) AND (ei.event_sub_type_id <> 22)) THEN true WHEN (ei.event_type_id = 4) THEN (2 = ANY (er_1.default_event_result_ids)) ELSE NULL::boolean END
  • Rows Removed by Filter: 1
46. 1.328 1.328 ↑ 1.0 1 83

Index Scan using idx_events_cid_lease_interval_id_event_datetime on events ei (cost=0.43..4.31 rows=1 width=36) (actual time=0.012..0.016 rows=1 loops=83)

  • Index Cond: ((cid = cne.cid) AND (lease_interval_id = cne.lease_interval_id))
  • Filter: ((NOT is_deleted) AND (event_type_id = ANY ('{1,3,4,5,6,15,17,173}'::integer[])))
  • Rows Removed by Filter: 9
47. 0.190 0.190 ↑ 1.0 1 95

Index Scan using idx_event_results on event_results er_1 (cost=0.28..2.50 rows=1 width=33) (actual time=0.002..0.002 rows=1 loops=95)

  • Index Cond: (id = ei.event_result_id)
  • Filter: ((cid = cne.cid) AND (cid = ei.cid))
48. 0.050 0.050 ↓ 0.0 0 10

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp1 (cost=0.56..2.79 rows=1 width=12) (actual time=0.005..0.005 rows=0 loops=10)

  • Index Cond: ((ei.cid = cid) AND (cid = cne.cid) AND (ei.property_id = property_id) AND ((key)::text = 'DO_NOT_CONSIDER_LEASING_CENTER_COMMUNICATION_AS_FOLLOW_UPS'::text))
  • Filter: ((value)::integer = 1)
49. 0.040 0.040 ↓ 0.0 0 10

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp2 (cost=0.56..2.79 rows=1 width=12) (actual time=0.003..0.004 rows=0 loops=10)

  • Index Cond: ((ei.cid = cid) AND (cid = cne.cid) AND (ei.property_id = property_id) AND ((key)::text = 'DO_NOT_CONSIDER_MESSAGE_CENTER_CORRESPONDENCE_AS_FOLLOW_UPS'::text))
  • Filter: ((value)::integer = 1)
50. 0.166 0.747 ↓ 0.0 0 83

Unique (cost=4.30..4.30 rows=1 width=61) (actual time=0.009..0.009 rows=0 loops=83)

51. 0.166 0.581 ↓ 0.0 0 83

Sort (cost=4.30..4.30 rows=1 width=61) (actual time=0.007..0.007 rows=0 loops=83)

  • Sort Key: ei_1.id DESC
  • Sort Method: quicksort Memory: 25kB
52. 0.083 0.415 ↓ 0.0 0 83

Result (cost=0.43..4.29 rows=1 width=61) (actual time=0.005..0.005 rows=0 loops=83)

  • One-Time Filter: (cne.cid = 13576)
53. 0.332 0.332 ↓ 0.0 0 83

Index Scan using idx_events_partial_dashboard_leads_applicants on events ei_1 (cost=0.43..4.29 rows=1 width=61) (actual time=0.004..0.004 rows=0 loops=83)

  • Index Cond: ((cid = 13576) AND (lease_interval_id = cne.lease_interval_id))
  • Filter: (event_type_id = 8)
  • Rows Removed by Filter: 1
54. 0.415 6.640 ↑ 1.0 1 83

Limit (cost=9.96..9.97 rows=1 width=16) (actual time=0.076..0.080 rows=1 loops=83)

55. 0.415 6.225 ↑ 1.0 1 83

Sort (cost=9.96..9.97 rows=1 width=16) (actual time=0.075..0.075 rows=1 loops=83)

  • Sort Key: ei_2.scheduled_datetime DESC, ei_2.id DESC
  • Sort Method: quicksort Memory: 25kB
56. 0.501 5.810 ↓ 5.0 5 83

Nested Loop Left Join (cost=1.55..9.95 rows=1 width=16) (actual time=0.014..0.070 rows=5 loops=83)

  • Filter: CASE WHEN (pp2_1.id IS NOT NULL) THEN (COALESCE(ei_2.ps_product_id, 0) <> 28) ELSE true END
57. 0.750 3.569 ↓ 5.0 5 83

Nested Loop Left Join (cost=0.99..7.15 rows=1 width=28) (actual time=0.009..0.043 rows=5 loops=83)

  • Filter: CASE WHEN (pp1_1.id IS NOT NULL) THEN (COALESCE(ei_2.ps_product_id, 0) <> 46) ELSE true END
58. 1.079 1.079 ↓ 5.0 5 83

Index Scan using idx_events_cid_lease_interval_id_event_datetime on events ei_2 (cost=0.43..4.35 rows=1 width=32) (actual time=0.004..0.013 rows=5 loops=83)

  • Index Cond: ((cid = cne.cid) AND (lease_interval_id = cne.lease_interval_id))
  • Filter: ((NOT is_deleted) AND (event_type_id = ANY ('{78,17,9,15,10,238,18,5,1,33,6,7,4,2,3,16,173,25}'::integer[])))
  • Rows Removed by Filter: 5
59. 1.740 1.740 ↓ 0.0 0 435

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp1_1 (cost=0.56..2.79 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=435)

  • Index Cond: ((ei_2.cid = cid) AND (cid = cne.cid) AND (ei_2.property_id = property_id) AND ((key)::text = 'DO_NOT_CONSIDER_LEASING_CENTER_COMMUNICATION_AS_FOLLOW_UPS'::text))
  • Filter: ((value)::integer = 1)
60. 1.740 1.740 ↓ 0.0 0 435

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp2_1 (cost=0.56..2.79 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=435)

  • Index Cond: ((ei_2.cid = cid) AND (cid = cne.cid) AND (ei_2.property_id = property_id) AND ((key)::text = 'DO_NOT_CONSIDER_MESSAGE_CENTER_CORRESPONDENCE_AS_FOLLOW_UPS'::text))
  • Filter: ((value)::integer = 1)
61. 1.185 1,768.637 ↓ 1,367.0 1,367 1

Subquery Scan on *SELECT* 2 (cost=62.83..62.87 rows=1 width=817) (actual time=1,762.000..1,768.637 rows=1,367 loops=1)

62. 1.538 1,767.452 ↓ 1,367.0 1,367 1

Subquery Scan on cs1 (cost=62.83..62.86 rows=1 width=1,261) (actual time=1,761.998..1,767.452 rows=1,367 loops=1)

  • Filter: ((cs1.lease_id = cs1.lease_customer_lease_id) AND (cs1.cid = 13576))
  • Rows Removed by Filter: 2
63. 2.258 1,765.914 ↓ 1,369.0 1,369 1

Unique (cost=62.83..62.84 rows=1 width=1,265) (actual time=1,761.994..1,765.914 rows=1,369 loops=1)

64. 6.564 1,763.656 ↓ 3,930.0 3,930 1

Sort (cost=62.83..62.84 rows=1 width=1,265) (actual time=1,761.993..1,763.656 rows=3,930 loops=1)

  • Sort Key: cs.id
  • Sort Method: quicksort Memory: 2353kB
65. 13.525 1,757.092 ↓ 3,930.0 3,930 1

WindowAgg (cost=62.65..62.82 rows=1 width=1,265) (actual time=1,741.944..1,757.092 rows=3,930 loops=1)

66. 7.980 1,743.567 ↓ 3,930.0 3,930 1

Sort (cost=62.65..62.65 rows=1 width=939) (actual time=1,741.907..1,743.567 rows=3,930 loops=1)

  • Sort Key: cs.customer_id, lc.id DESC
  • Sort Method: quicksort Memory: 2323kB
67. 7.657 1,735.587 ↓ 3,930.0 3,930 1

Nested Loop Left Join (cost=4.91..62.64 rows=1 width=939) (actual time=32.186..1,735.587 rows=3,930 loops=1)

68. 8.025 1,716.140 ↓ 3,930.0 3,930 1

Nested Loop Left Join (cost=4.49..60.08 rows=1 width=910) (actual time=32.174..1,716.140 rows=3,930 loops=1)

69. 6.805 1,704.185 ↓ 3,930.0 3,930 1

Nested Loop Left Join (cost=4.19..59.74 rows=1 width=897) (actual time=32.170..1,704.185 rows=3,930 loops=1)

70. 5.197 1,686.950 ↓ 1,490.0 1,490 1

Nested Loop Left Join (cost=3.77..57.51 rows=1 width=901) (actual time=32.159..1,686.950 rows=1,490 loops=1)

  • Filter: CASE WHEN ((cl_1.lease_status_type_id = 6) AND ((COALESCE(lps.move_out_date, li.lease_end_date) + COALESCE((pp.value)::integer, 60)) > CURRENT_DATE)) THEN ((cl_1.id IS NULL) OR (cl_1.lease_status_type_id = ANY ('{3,5,6,4}'::integer[]))) ELSE ((cl_1.id IS NULL) OR (cl_1.lease_status_type_id = ANY ('{3,4,5}'::integer[]))) END
  • Rows Removed by Filter: 723
71. 4.105 1,668.475 ↓ 2,213.0 2,213 1

Nested Loop Left Join (cost=3.21..54.69 rows=1 width=913) (actual time=4.865..1,668.475 rows=2,213 loops=1)

72. 4.782 1,659.944 ↓ 2,213.0 2,213 1

Nested Loop Left Join (cost=3.08..54.54 rows=1 width=799) (actual time=4.859..1,659.944 rows=2,213 loops=1)

73. 5.802 1,650.736 ↓ 2,213.0 2,213 1

Nested Loop Left Join (cost=2.95..54.38 rows=1 width=685) (actual time=4.853..1,650.736 rows=2,213 loops=1)

  • Join Filter: (cs.cid = lps.cid)
74. 5.421 1,634.564 ↓ 2,074.0 2,074 1

Nested Loop Left Join (cost=2.52..53.38 rows=1 width=681) (actual time=4.842..1,634.564 rows=2,074 loops=1)

  • Join Filter: (li.cid = cs.cid)
75. 5.341 1,620.847 ↓ 2,074.0 2,074 1

Nested Loop Left Join (cost=2.10..52.27 rows=1 width=681) (actual time=4.830..1,620.847 rows=2,074 loops=1)

76. 3.591 1,607.210 ↓ 2,074.0 2,074 1

Nested Loop Left Join (cost=1.68..51.39 rows=1 width=661) (actual time=4.818..1,607.210 rows=2,074 loops=1)

77. 4.977 1,601.545 ↓ 2,074.0 2,074 1

Nested Loop Left Join (cost=1.53..51.20 rows=1 width=651) (actual time=4.806..1,601.545 rows=2,074 loops=1)

78. 4.669 1,590.346 ↓ 2,074.0 2,074 1

Nested Loop (cost=1.39..50.99 rows=1 width=619) (actual time=4.795..1,590.346 rows=2,074 loops=1)

79. 5.265 1,581.529 ↓ 2,074.0 2,074 1

Nested Loop (cost=1.26..50.59 rows=1 width=405) (actual time=4.788..1,581.529 rows=2,074 loops=1)

  • Join Filter: (lp_1.property_id = p_1.id)
80. 5.848 1,570.042 ↓ 2,074.0 2,074 1

Nested Loop (cost=0.97..50.21 rows=1 width=391) (actual time=4.780..1,570.042 rows=2,074 loops=1)

  • Join Filter: (lp_1.property_id = lc.property_id)
81. 2.558 100.648 ↓ 1,954.0 1,954 1

Nested Loop (cost=0.54..46.81 rows=1 width=371) (actual time=2.560..100.648 rows=1,954 loops=1)

82. 2.315 2.315 ↓ 25.0 25 1

Function Scan on load_properties lp_1 (cost=0.25..0.88 rows=1 width=4) (actual time=2.292..2.315 rows=25 loops=1)

  • Filter: (is_disabled = 0)
  • Rows Removed by Filter: 15
83. 9.955 95.775 ↓ 78.0 78 25

Index Scan using idx_contact_submissions_property_id on contact_submissions cs (cost=0.29..45.92 rows=1 width=367) (actual time=0.066..3.831 rows=78 loops=25)

  • Index Cond: (property_id = lp_1.property_id)
  • Filter: ((deleted_on IS NULL) AND (deleted_by IS NULL) AND (customer_message_id IS NULL) AND (cid = 13576) AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 178
84.          

SubPlan (forIndex Scan)

85. 4.904 85.820 ↓ 0.0 0 2,452

Unique (cost=4.47..4.48 rows=1 width=4) (actual time=0.035..0.035 rows=0 loops=2,452)

86. 7.356 80.916 ↓ 0.0 0 2,452

Sort (cost=4.47..4.47 rows=1 width=4) (actual time=0.033..0.033 rows=0 loops=2,452)

  • Sort Key: e_1.data_reference_id
  • Sort Method: quicksort Memory: 25kB
87. 4.904 73.560 ↓ 0.0 0 2,452

Result (cost=0.56..4.46 rows=1 width=4) (actual time=0.021..0.030 rows=0 loops=2,452)

  • One-Time Filter: (cs.cid = 13576)
88. 68.656 68.656 ↓ 0.0 0 2,452

Index Scan using idx_events_cid_etid_pid_event_datetime on events e_1 (cost=0.56..4.46 rows=1 width=4) (actual time=0.019..0.028 rows=0 loops=2,452)

  • Index Cond: ((cid = 13576) AND (event_type_id = ANY ('{339,340}'::integer[])) AND (property_id = cs.property_id))
  • Filter: ((data_reference_id IS NOT NULL) AND (customer_id = cs.customer_id))
  • Rows Removed by Filter: 33
89. 1,463.546 1,463.546 ↑ 1.0 1 1,954

Index Scan using idx_lease_customers_cid_property_id on lease_customers lc (cost=0.42..3.39 rows=1 width=24) (actual time=0.444..0.749 rows=1 loops=1,954)

  • Index Cond: ((cid = 13576) AND (property_id = cs.property_id))
  • Filter: (cs.customer_id = customer_id)
  • Rows Removed by Filter: 1674
90. 6.222 6.222 ↑ 1.0 1 2,074

Index Scan using idx_properties_id on properties p_1 (cost=0.29..0.37 rows=1 width=30) (actual time=0.003..0.003 rows=1 loops=2,074)

  • Index Cond: (id = lc.property_id)
  • Filter: (cid = 13576)
91. 4.148 4.148 ↑ 1.0 1 2,074

Index Scan using pk_time_zones on time_zones tz_1 (cost=0.14..0.36 rows=1 width=222) (actual time=0.002..0.002 rows=1 loops=2,074)

  • Index Cond: (id = p_1.time_zone_id)
92. 6.222 6.222 ↑ 1.0 1 2,074

Index Scan using idx_dashboard_priorities_cid on dashboard_priorities dp (cost=0.14..0.20 rows=1 width=36) (actual time=0.002..0.003 rows=1 loops=2,074)

  • Index Cond: ((cid = cs.cid) AND (cid = 13576))
93. 2.074 2.074 ↓ 0.0 0 2,074

Index Scan using idx_contact_submission_types_id on contact_submission_types cst (cost=0.14..0.18 rows=1 width=18) (actual time=0.001..0.001 rows=0 loops=2,074)

  • Index Cond: (id = cs.contact_submission_type_id)
  • Filter: ((deleted_on IS NULL) AND (cid = 13576) AND (is_published = 1) AND (cid = cs.cid))
94. 8.296 8.296 ↑ 1.0 1 2,074

Index Scan using pk_cached_leases on cached_leases cl_1 (cost=0.42..0.87 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=2,074)

  • Index Cond: ((cid = lc.cid) AND (cid = 13576) AND (id = lc.lease_id))
95. 8.296 8.296 ↑ 1.0 1 2,074

Index Scan using idx_lease_intervals on lease_intervals li (cost=0.42..1.10 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=2,074)

  • Index Cond: (id = cl_1.active_lease_interval_id)
  • Filter: ((lease_status_type_id <> 2) AND (cid = 13576))
  • Rows Removed by Filter: 0
96. 10.370 10.370 ↑ 1.0 1 2,074

Index Scan using idx_lease_processes_cid_lease_id_customer_id on lease_processes lps (cost=0.42..0.99 rows=1 width=12) (actual time=0.004..0.005 rows=1 loops=2,074)

  • Index Cond: ((cid = 13576) AND (cl_1.id = lease_id))
97. 4.426 4.426 ↑ 1.0 1 2,213

Index Scan using pk_lease_status_types on lease_status_types lst_1 (cost=0.13..0.15 rows=1 width=122) (actual time=0.002..0.002 rows=1 loops=2,213)

  • Index Cond: (lc.lease_status_type_id = id)
98. 4.426 4.426 ↑ 1.0 1 2,213

Index Scan using pk_lease_interval_types on lease_interval_types lit_1 (cost=0.13..0.15 rows=1 width=122) (actual time=0.002..0.002 rows=1 loops=2,213)

  • Index Cond: (id = cl_1.lease_interval_type_id)
99. 13.278 13.278 ↑ 1.0 1 2,213

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp (cost=0.56..2.78 rows=1 width=19) (actual time=0.006..0.006 rows=1 loops=2,213)

  • Index Cond: ((cs.cid = cid) AND (cid = 13576) AND (cs.property_id = property_id) AND ((key)::text = 'PAST_RESIDENT_LOGIN_TOLERANCE_DAYS'::text))
100. 10.430 10.430 ↓ 3.0 3 1,490

Index Scan using idx_cached_applications_lease_id on cached_applications ca_1 (cost=0.42..2.22 rows=1 width=16) (actual time=0.004..0.007 rows=3 loops=1,490)

  • Index Cond: (cl_1.id = lease_id)
  • Filter: ((cid = 13576) AND (cl_1.cid = cid) AND (property_id = cl_1.property_id))
  • Rows Removed by Filter: 0
101. 3.930 3.930 ↓ 0.0 0 3,930

Index Scan using idx_company_employees_id on company_employees ce_1 (cost=0.29..0.33 rows=1 width=21) (actual time=0.001..0.001 rows=0 loops=3,930)

  • Index Cond: (id = ca_1.leasing_agent_id)
  • Filter: ((cid = 13576) AND (cid = ca_1.cid))
102. 11.790 11.790 ↑ 1.0 1 3,930

Index Scan using uk_cid_customer_id on customer_portal_settings cps (cost=0.42..2.55 rows=1 width=37) (actual time=0.003..0.003 rows=1 loops=3,930)

  • Index Cond: ((cid = cs.cid) AND (cid = 13576) AND (customer_id = cs.customer_id))