explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XxaZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.100 2,487.027 ↓ 15.0 30 1

Limit (cost=6,460.44..6,460.52 rows=2 width=1,038) (actual time=2,486.866..2,487.027 rows=30 loops=1)

2. 0.058 2,486.927 ↓ 15.0 30 1

Result (cost=6,460.44..6,460.52 rows=2 width=1,038) (actual time=2,486.864..2,486.927 rows=30 loops=1)

3. 0.718 2,486.869 ↓ 15.0 30 1

Sort (cost=6,460.44..6,460.44 rows=2 width=1,006) (actual time=2,486.856..2,486.869 rows=30 loops=1)

  • Sort Key: cne.priority DESC NULLS LAST, cne.overdue_business_days DESC
  • Sort Method: top-N heapsort Memory: 42kB
4. 1.700 2,486.151 ↓ 683.5 1,367 1

Unique (cost=6,460.23..6,460.41 rows=2 width=1,006) (actual time=2,483.896..2,486.151 rows=1,367 loops=1)

5. 2.165 2,484.451 ↓ 683.5 1,367 1

Sort (cost=6,460.23..6,460.23 rows=2 width=1,006) (actual time=2,483.895..2,484.451 rows=1,367 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, lp.time_zone_name, (concat_ws(' - '::text, lst.name, lit.name))
  • Sort Method: quicksort Memory: 812kB
6. 1.065 2,482.286 ↓ 683.5 1,367 1

Append (cost=5,297.11..6,460.22 rows=2 width=1,006) (actual time=2,474.592..2,482.286 rows=1,367 loops=1)

7. 0.001 2,219.496 ↓ 0.0 0 1

Unique (cost=5,297.11..5,297.19 rows=1 width=547) (actual time=2,219.495..2,219.496 rows=0 loops=1)

8. 0.030 2,219.495 ↓ 0.0 0 1

Sort (cost=5,297.11..5,297.12 rows=1 width=547) (actual time=2,219.494..2,219.495 rows=0 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, lp.time_zone_name, (concat_ws(' - '::text, lst.name, lit.name))
  • Sort Method: quicksort Memory: 25kB
9. 0.001 2,219.465 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,288.79..5,297.10 rows=1 width=547) (actual time=2,219.465..2,219.465 rows=0 loops=1)

10. 0.001 2,219.464 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,278.83..5,287.07 rows=1 width=579) (actual time=2,219.463..2,219.464 rows=0 loops=1)

11. 0.001 2,219.463 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,274.53..5,282.75 rows=1 width=526) (actual time=2,219.462..2,219.463 rows=0 loops=1)

12. 0.002 2,219.462 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,262.03..5,270.22 rows=1 width=514) (actual time=2,219.461..2,219.462 rows=0 loops=1)

13. 0.001 2,219.460 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,261.74..5,269.88 rows=1 width=501) (actual time=2,219.460..2,219.460 rows=0 loops=1)

14. 0.001 2,219.459 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,261.60..5,269.72 rows=1 width=387) (actual time=2,219.459..2,219.459 rows=0 loops=1)

15. 0.001 2,219.458 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,261.18..5,267.07 rows=1 width=387) (actual time=2,219.458..2,219.458 rows=0 loops=1)

16. 0.001 2,219.457 ↓ 0.0 0 1

Nested Loop (cost=5,261.03..5,264.68 rows=1 width=363) (actual time=2,219.456..2,219.457 rows=0 loops=1)

17. 0.012 2,219.456 ↓ 0.0 0 1

Hash Join (cost=5,260.89..5,262.30 rows=1 width=346) (actual time=2,219.455..2,219.456 rows=0 loops=1)

  • Hash Cond: (lp.property_id = cne.property_id)
18. 0.009 0.009 ↑ 25.0 1 1

Seq Scan on temp_properties lp (cost=0.00..1.31 rows=25 width=23) (actual time=0.008..0.009 rows=1 loops=1)

  • Filter: (cid = 13576)
19. 0.001 2,219.435 ↓ 0.0 0 1

Hash (cost=5,260.87..5,260.87 rows=1 width=331) (actual time=2,219.434..2,219.435 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
20. 0.001 2,219.434 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,257.55..5,260.87 rows=1 width=331) (actual time=2,219.433..2,219.434 rows=0 loops=1)

  • Filter: (CURRENT_DATE >= COALESCE(ca.mute_followups_until, CURRENT_DATE))
21. 0.012 2,219.433 ↓ 0.0 0 1

Hash Right Join (cost=5,257.12..5,258.20 rows=1 width=327) (actual time=2,219.432..2,219.433 rows=0 loops=1)

  • Hash Cond: (lit.id = cne.lease_interval_type_id)
22. 0.000 0.000 ↓ 0.0 0

Seq Scan on lease_interval_types lit (cost=0.00..1.05 rows=5 width=122) (never executed)

23. 0.001 2,219.421 ↓ 0.0 0 1

Hash (cost=5,257.11..5,257.11 rows=1 width=213) (actual time=2,219.421..2,219.421 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
24. 0.001 2,219.420 ↓ 0.0 0 1

Subquery Scan on cne (cost=5,256.97..5,257.11 rows=1 width=213) (actual time=2,219.419..2,219.420 rows=0 loops=1)

25. 0.001 2,219.419 ↓ 0.0 0 1

Unique (cost=5,256.97..5,257.10 rows=1 width=580) (actual time=2,219.418..2,219.419 rows=0 loops=1)

26. 0.043 2,219.418 ↓ 0.0 0 1

Sort (cost=5,256.97..5,256.98 rows=1 width=580) (actual time=2,219.417..2,219.418 rows=0 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 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), (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: 25kB
27. 0.477 2,219.375 ↓ 0.0 0 1

Nested Loop (cost=2.29..5,256.96 rows=1 width=580) (actual time=2,219.374..2,219.375 rows=0 loops=1)

28. 0.563 2,216.918 ↓ 396.0 396 1

Nested Loop (cost=1.87..5,254.29 rows=1 width=464) (actual time=2.377..2,216.918 rows=396 loops=1)

29. 0.067 0.080 ↑ 1.0 25 1

HashAggregate (cost=1.31..1.56 rows=25 width=4) (actual time=0.033..0.080 rows=25 loops=1)

  • Group Key: temp_properties.property_id
30. 0.013 0.013 ↑ 1.0 25 1

Seq Scan on temp_properties (cost=0.00..1.25 rows=25 width=4) (actual time=0.002..0.013 rows=25 loops=1)

31. 2,216.275 2,216.275 ↓ 16.0 16 25

Index Scan using idx_events_s1314 on events e (cost=0.56..210.10 rows=1 width=464) (actual time=17.422..88.651 rows=16 loops=25)

  • Index Cond: ((cid = 13576) AND (property_id = temp_properties.property_id))
  • Filter: ((NOT is_deleted) AND (lease_id IS NOT NULL) AND (event_result_id IS NULL) 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 ((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: 109102
32. 1.980 1.980 ↓ 0.0 0 396

Index Scan using pk_cached_leases on cached_leases cl (cost=0.42..2.50 rows=1 width=68) (actual time=0.005..0.005 rows=0 loops=396)

  • Index Cond: ((cid = 13576) AND (id = e.lease_id))
  • Filter: ((lease_status_type_id = ANY ('{1,3,4,5}'::integer[])) AND CASE WHEN (lease_status_type_id = 1) THEN ((lease_interval_type_id = 5) OR (e.event_type_id = 316)) ELSE NULL::boolean END AND (occupancy_type_id = ANY ('{1,2,3,4,6,9,10,11}'::integer[])))
  • Rows Removed by Filter: 1
33. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_cached_applications_lease_interval_id on cached_applications ca (cost=0.42..2.65 rows=1 width=24) (never executed)

  • 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))
34. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_event_types on event_types et (cost=0.15..2.37 rows=1 width=25) (never executed)

  • Index Cond: (id = cne.event_type_id)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_event_sub_types on event_sub_types est (cost=0.14..2.36 rows=1 width=28) (never executed)

  • Index Cond: (id = cne.event_sub_type_id)
36. 0.000 0.000 ↓ 0.0 0

Index Only 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=16) (never executed)

  • Index Cond: ((cid = cne.cid) AND (cid = 13576) AND (lease_id = cne.lease_id) AND (customer_id = cne.customer_id))
  • Heap Fetches: 0
37. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_lease_status_types on lease_status_types lst (cost=0.13..0.15 rows=1 width=122) (never executed)

  • Index Cond: (lcs.lease_status_type_id = id)
38. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_company_employees_id on company_employees ce (cost=0.29..0.33 rows=1 width=21) (never executed)

  • Index Cond: (id = ca.leasing_agent_id)
  • Filter: ((cid = 13576) AND (cid = ca.cid))
39. 0.000 0.000 ↓ 0.0 0

Limit (cost=12.50..12.51 rows=1 width=16) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Sort (cost=12.50..12.51 rows=1 width=16) (never executed)

  • Sort Key: ei.scheduled_datetime DESC, ei.id DESC
41. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.83..12.49 rows=1 width=16) (never executed)

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

Nested Loop Left Join (cost=1.27..9.69 rows=1 width=28) (never executed)

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

Nested Loop Left Join (cost=0.71..6.89 rows=1 width=28) (never executed)

  • Filter: CASE WHEN ((ei.event_type_id = 15) AND (ei.event_sub_type_id = 2)) THEN ((1 = ANY (er.default_event_result_ids)) OR (2 = ANY (er.default_event_result_ids)) OR (3 = ANY (er.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.default_event_result_ids)) ELSE NULL::boolean END
44. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_events_cid_lease_interval_id_event_datetime on events ei (cost=0.43..4.31 rows=1 width=36) (never executed)

  • 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[])))
45. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_event_results on event_results er (cost=0.28..2.50 rows=1 width=33) (never executed)

  • Index Cond: (id = ei.event_result_id)
  • Filter: ((cid = cne.cid) AND (cid = ei.cid))
46. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp1 (cost=0.56..2.79 rows=1 width=12) (never executed)

  • 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)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp2 (cost=0.56..2.79 rows=1 width=12) (never executed)

  • 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)
48. 0.000 0.000 ↓ 0.0 0

Limit (cost=4.30..4.30 rows=1 width=57) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.30..4.30 rows=1 width=57) (never executed)

  • Sort Key: ei_1.id DESC
50. 0.000 0.000 ↓ 0.0 0

Result (cost=0.43..4.29 rows=1 width=57) (never executed)

  • One-Time Filter: (cne.cid = 13576)
51. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_events_partial_dashboard_leads_applicants on events ei_1 (cost=0.43..4.29 rows=1 width=57) (never executed)

  • Index Cond: ((cid = 13576) AND (lease_interval_id = cne.lease_interval_id))
  • Filter: (event_type_id = 8)
52. 0.000 0.000 ↓ 0.0 0

Limit (cost=9.96..9.97 rows=1 width=16) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Sort (cost=9.96..9.97 rows=1 width=16) (never executed)

  • Sort Key: ei_2.scheduled_datetime DESC, ei_2.id DESC
54. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.55..9.95 rows=1 width=16) (never executed)

  • Filter: CASE WHEN (pp2_1.id IS NOT NULL) THEN (COALESCE(ei_2.ps_product_id, 0) <> 28) ELSE true END
55. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.99..7.15 rows=1 width=28) (never executed)

  • Filter: CASE WHEN (pp1_1.id IS NOT NULL) THEN (COALESCE(ei_2.ps_product_id, 0) <> 46) ELSE true END
56. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_events_cid_lease_interval_id_event_datetime on events ei_2 (cost=0.43..4.35 rows=1 width=32) (never executed)

  • 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[])))
57. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp1_1 (cost=0.56..2.79 rows=1 width=12) (never executed)

  • 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)
58. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp2_1 (cost=0.56..2.79 rows=1 width=12) (never executed)

  • 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)
59. 1.202 261.725 ↓ 1,367.0 1,367 1

Subquery Scan on *SELECT* 2 (cost=1,162.98..1,163.01 rows=1 width=615) (actual time=255.095..261.725 rows=1,367 loops=1)

60. 1.532 260.523 ↓ 1,367.0 1,367 1

Subquery Scan on cs1 (cost=1,162.98..1,163.00 rows=1 width=1,059) (actual time=255.092..260.523 rows=1,367 loops=1)

  • Filter: ((cs1.lease_id = cs1.lease_customer_lease_id) AND (cs1.cid = 13576))
  • Rows Removed by Filter: 2
61. 2.259 258.991 ↓ 1,369.0 1,369 1

Unique (cost=1,162.98..1,162.99 rows=1 width=1,063) (actual time=255.089..258.991 rows=1,369 loops=1)

62. 6.500 256.732 ↓ 3,930.0 3,930 1

Sort (cost=1,162.98..1,162.99 rows=1 width=1,063) (actual time=255.087..256.732 rows=3,930 loops=1)

  • Sort Key: cs.id
  • Sort Method: quicksort Memory: 2353kB
63. 13.457 250.232 ↓ 3,930.0 3,930 1

WindowAgg (cost=1,162.80..1,162.97 rows=1 width=1,063) (actual time=235.162..250.232 rows=3,930 loops=1)

64. 7.686 236.775 ↓ 3,930.0 3,930 1

Sort (cost=1,162.80..1,162.80 rows=1 width=737) (actual time=235.124..236.775 rows=3,930 loops=1)

  • Sort Key: cs.customer_id, lc.id DESC
  • Sort Method: quicksort Memory: 2323kB
65. 6.200 229.089 ↓ 3,930.0 3,930 1

Nested Loop Left Join (cost=3.97..1,162.79 rows=1 width=737) (actual time=5.616..229.089 rows=3,930 loops=1)

66. 6.897 211.099 ↓ 3,930.0 3,930 1

Nested Loop Left Join (cost=3.55..1,160.23 rows=1 width=708) (actual time=5.598..211.099 rows=3,930 loops=1)

67. 5.436 200.272 ↓ 3,930.0 3,930 1

Nested Loop Left Join (cost=3.25..1,159.89 rows=1 width=695) (actual time=5.586..200.272 rows=3,930 loops=1)

68. 3.964 184.406 ↓ 1,490.0 1,490 1

Nested Loop Left Join (cost=2.83..1,157.66 rows=1 width=699) (actual time=5.569..184.406 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: 769
69. 5.869 169.147 ↓ 2,259.0 2,259 1

Nested Loop Left Join (cost=2.27..1,154.84 rows=1 width=711) (actual time=0.865..169.147 rows=2,259 loops=1)

  • Join Filter: (lit_1.id = cl_1.lease_interval_type_id)
  • Rows Removed by Join Filter: 1673
70. 8.367 161.019 ↓ 2,259.0 2,259 1

Nested Loop Left Join (cost=2.27..1,153.73 rows=1 width=597) (actual time=0.857..161.019 rows=2,259 loops=1)

  • Join Filter: (lc.lease_status_type_id = lst_1.id)
  • Rows Removed by Join Filter: 6599
71. 5.321 148.134 ↓ 2,259.0 2,259 1

Nested Loop Left Join (cost=2.27..1,152.60 rows=1 width=483) (actual time=0.845..148.134 rows=2,259 loops=1)

  • Join Filter: (cs.cid = lps.cid)
72. 3.493 134.333 ↓ 2,120.0 2,120 1

Nested Loop Left Join (cost=1.85..1,151.59 rows=1 width=479) (actual time=0.829..134.333 rows=2,120 loops=1)

  • Join Filter: (li.cid = cs.cid)
73. 3.293 122.360 ↓ 2,120.0 2,120 1

Nested Loop Left Join (cost=1.42..1,150.48 rows=1 width=479) (actual time=0.812..122.360 rows=2,120 loops=1)

74. 2.959 110.587 ↓ 2,120.0 2,120 1

Nested Loop Left Join (cost=1.00..1,149.61 rows=1 width=459) (actual time=0.798..110.587 rows=2,120 loops=1)

75. 5.186 105.508 ↓ 2,120.0 2,120 1

Nested Loop Left Join (cost=0.85..1,149.41 rows=1 width=449) (actual time=0.784..105.508 rows=2,120 loops=1)

76. 4.219 96.082 ↓ 2,120.0 2,120 1

Nested Loop (cost=0.71..1,149.21 rows=1 width=417) (actual time=0.771..96.082 rows=2,120 loops=1)

77. 2.119 84.047 ↓ 977.0 1,954 1

Nested Loop (cost=0.29..1,142.10 rows=2 width=401) (actual time=0.302..84.047 rows=1,954 loops=1)

78. 0.028 0.028 ↑ 1.0 25 1

Seq Scan on temp_properties lp_1 (cost=0.00..1.31 rows=25 width=42) (actual time=0.009..0.028 rows=25 loops=1)

  • Filter: (cid = 13576)
79. 8.340 81.900 ↓ 78.0 78 25

Index Scan using idx_contact_submissions_property_id on contact_submissions cs (cost=0.29..45.62 rows=1 width=367) (actual time=0.065..3.276 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
80.          

SubPlan (forIndex Scan)

81. 2.452 73.560 ↓ 0.0 0 2,452

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

82. 7.356 71.108 ↓ 0.0 0 2,452

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

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

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

  • One-Time Filter: (cs.cid = 13576)
84. 58.848 58.848 ↓ 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.016..0.024 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
85. 7.816 7.816 ↑ 1.0 1 1,954

Index Scan using idx_lease_customers_customer_id on lease_customers lc (cost=0.42..3.54 rows=1 width=20) (actual time=0.003..0.004 rows=1 loops=1,954)

  • Index Cond: (customer_id = cs.customer_id)
  • Filter: (cid = 13576)
  • Rows Removed by Filter: 0
86. 4.240 4.240 ↑ 1.0 1 2,120

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.002 rows=1 loops=2,120)

  • Index Cond: ((cid = cs.cid) AND (cid = 13576))
87. 2.120 2.120 ↓ 0.0 0 2,120

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,120)

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

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,120)

  • Index Cond: ((cid = lc.cid) AND (cid = 13576) AND (id = lc.lease_id))
89. 8.480 8.480 ↑ 1.0 1 2,120

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,120)

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

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.004 rows=1 loops=2,120)

  • Index Cond: ((cid = 13576) AND (cl_1.id = lease_id))
91. 4.518 4.518 ↑ 1.5 4 2,259

Seq Scan on lease_status_types lst_1 (cost=0.00..1.06 rows=6 width=122) (actual time=0.001..0.002 rows=4 loops=2,259)

92. 2.259 2.259 ↑ 2.5 2 2,259

Seq Scan on lease_interval_types lit_1 (cost=0.00..1.05 rows=5 width=122) (actual time=0.001..0.001 rows=2 loops=2,259)

93. 11.295 11.295 ↑ 1.0 1 2,259

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.005..0.005 rows=1 loops=2,259)

  • Index Cond: ((cs.cid = cid) AND (cid = 13576) AND (cs.property_id = property_id) AND ((key)::text = 'PAST_RESIDENT_LOGIN_TOLERANCE_DAYS'::text))
94. 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
95. 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))
96. 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))