explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9Opy

Settings
# exclusive inclusive rows x rows loops node
1. 0.366 371,452.036 ↓ 26.5 159 1

Sort (cost=32,590.70..32,590.72 rows=6 width=404) (actual time=371,451.941..371,452.036 rows=159 loops=1)

  • Sort Key: cev.title
  • Sort Method: quicksort Memory: 165kB
2. 0.046 371,451.670 ↓ 26.5 159 1

Append (cost=4.38..32,590.63 rows=6 width=404) (actual time=63.827..371,451.670 rows=159 loops=1)

3. 0.003 30.834 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.38..4,623.23 rows=1 width=473) (actual time=30.814..30.834 rows=0 loops=1)

4. 0.002 30.831 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.09..4,622.63 rows=1 width=1,114) (actual time=30.813..30.831 rows=0 loops=1)

5. 0.003 30.829 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.67..4,622.02 rows=1 width=1,114) (actual time=30.812..30.829 rows=0 loops=1)

  • Join Filter: (cet.default_calendar_event_type_id = 12)
6. 0.002 30.826 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.39..4,621.00 rows=1 width=1,106) (actual time=30.811..30.826 rows=0 loops=1)

7. 0.002 30.824 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.96..4,618.87 rows=1 width=1,097) (actual time=30.810..30.824 rows=0 loops=1)

8. 0.002 30.822 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.54..4,616.47 rows=1 width=1,093) (actual time=30.810..30.822 rows=0 loops=1)

9. 0.002 30.820 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.25..4,616.06 rows=1 width=1,087) (actual time=30.809..30.820 rows=0 loops=1)

10. 0.006 30.818 ↓ 0.0 0 1

Nested Loop (cost=1.68..4,613.43 rows=1 width=822) (actual time=30.809..30.818 rows=0 loops=1)

11. 0.001 30.812 ↓ 0.0 0 1

Nested Loop (cost=1.27..4,605.73 rows=1 width=809) (actual time=30.808..30.812 rows=0 loops=1)

12. 0.002 30.811 ↓ 0.0 0 1

Nested Loop (cost=1.12..4,605.53 rows=1 width=362) (actual time=30.808..30.811 rows=0 loops=1)

13. 0.005 30.809 ↓ 0.0 0 1

Nested Loop (cost=0.70..4,603.05 rows=1 width=27) (actual time=30.807..30.809 rows=0 loops=1)

  • Join Filter: (cea.company_user_id = cuc.calendar_company_user_id)
14. 0.344 0.344 ↓ 2.0 2 1

Index Scan using pk_company_user_calendars on company_user_calendars cuc (cost=0.28..119.81 rows=1 width=19) (actual time=0.339..0.344 rows=2 loops=1)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = 5,444)
  • Rows Removed by Filter: 923
15. 30.460 30.460 ↓ 0.0 0 2

Index Scan using pk_calendar_event_associations on calendar_event_associations cea (cost=0.42..4,482.42 rows=25 width=12) (actual time=15.230..15.230 rows=0 loops=2)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = ANY ('{148647,148648}'::integer[]))
  • Rows Removed by Filter: 70,606
16. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_calendar_events on calendar_events cev (cost=0.42..2.48 rows=1 width=339) (never executed)

  • Index Cond: ((cid = 12,876) AND (id = cea.calendar_event_id))
  • Filter: ((deleted_on IS NULL) AND (end_datetime >= '09/20/2020 12:30:00 MDT'::timestamp with time zone) AND (start_datetime <= '10/03/2020 12:30:00 MDT'::timestamp with time zone) AND (calendar_event_type_id = ANY ('{3931,3930,3932,5310,3933,3934,3936,3935,3938,8496,3937,8509,4935,4934}'::integer[])))
17. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_calendar_event_types on calendar_event_types cet (cost=0.14..0.20 rows=1 width=455) (never executed)

  • Index Cond: ((cid = 12,876) AND (id = cev.calendar_event_type_id))
18. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_company_users on company_users cu (cost=0.42..7.66 rows=1 width=29) (never executed)

  • Index Cond: ((cid = 12,876) AND (id = cea.company_user_id))
  • Filter: ((company_user_type_id = ANY ('{13,14,2}'::integer[])) AND ((id = 5,444) OR (is_administrator = 1) OR (SubPlan 1)))
19.          

SubPlan (for Index Scan)

20. 0.000 0.000 ↓ 0.0 0

Result (cost=3.24..5.20 rows=1 width=0) (never executed)

  • One-Time Filter: (cu.is_administrator = 0)
21. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=3.24..5.20 rows=1 width=0) (never executed)

  • Join Filter: (cupg.property_group_id = pg.id)
22. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2.96..4.67 rows=1 width=12) (never executed)

  • Hash Cond: (lp_5.property_id = pga.property_id)
23. 0.000 0.000 ↓ 0.0 0

Function Scan on load_properties lp_5 (cost=0.25..1.75 rows=50 width=4) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Hash (cost=2.67..2.67 rows=1 width=16) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..2.67 rows=1 width=16) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Index Only Scan using uk_cupg_cid_company_user_id_property_group_id on company_user_property_groups cupg (cost=0.29..1.32 rows=1 width=4) (never executed)

  • Index Cond: ((cid = cea.cid) AND (company_user_id = cea.company_user_id))
  • Heap Fetches: 0
27. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_property_group_associations_master on property_group_associations pga (cost=0.28..1.32 rows=1 width=12) (never executed)

  • Index Cond: ((cid = cu.cid) AND (property_group_id = cupg.property_group_id))
  • Heap Fetches: 0
28. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_property_groups_id on property_groups pg (cost=0.28..0.49 rows=1 width=8) (never executed)

  • Index Cond: (id = pga.property_group_id)
  • Filter: ((deleted_by IS NULL) AND (deleted_on IS NULL) AND (cid = cu.cid))
29. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_events_id on events e (cost=0.56..2.60 rows=1 width=273) (never executed)

  • Index Cond: (cev.event_id = id)
  • Filter: ((cid = 12,876) AND (cev.cid = cid))
30. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = cu.company_employee_id)
  • Filter: ((cid = 12,876) AND (cid = cu.cid))
31. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_applications_id on applications a (cost=0.43..2.37 rows=1 width=12) (never executed)

  • Index Cond: (cev.application_id = id)
  • Filter: ((cid = 12,876) AND (cev.cid = cid))
32. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_cached_leases on cached_leases cl (cost=0.42..2.13 rows=1 width=17) (never executed)

  • Index Cond: ((cev.cid = cid) AND (cid = 12,876) AND (id = cev.lease_id))
33. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_property_amenity_reservations_id on property_add_on_reservations par (cost=0.29..0.98 rows=1 width=12) (never executed)

  • Index Cond: (id = cev.reference_id)
  • Filter: ((cid = 12,876) AND (cid = cev.cid))
34. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_rate_associations on rate_associations ra (cost=0.42..0.61 rows=1 width=12) (never executed)

  • Index Cond: ((cid = par.cid) AND (cid = 12,876) AND (id = par.rate_association_id))
35. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_add_ons on add_ons add (cost=0.28..0.34 rows=1 width=18) (never executed)

  • Index Cond: ((cid = ra.cid) AND (cid = 12,876) AND (id = ra.ar_origin_reference_id))
36. 0.054 62.205 ↓ 142.0 142 1

Subquery Scan on *SELECT* 2 (cost=6.89..4,641.36 rows=1 width=473) (actual time=33.011..62.205 rows=142 loops=1)

37. 4.204 62.151 ↓ 142.0 142 1

Nested Loop Left Join (cost=6.89..4,641.33 rows=1 width=462) (actual time=33.008..62.151 rows=142 loops=1)

38. 0.034 57.805 ↓ 142.0 142 1

Nested Loop (cost=6.33..4,638.43 rows=1 width=841) (actual time=32.306..57.805 rows=142 loops=1)

39. 0.113 57.487 ↓ 142.0 142 1

Nested Loop Left Join (cost=6.05..4,638.11 rows=1 width=828) (actual time=32.280..57.487 rows=142 loops=1)

40. 0.318 56.948 ↓ 142.0 142 1

Nested Loop Left Join (cost=5.63..4,635.92 rows=1 width=823) (actual time=32.274..56.948 rows=142 loops=1)

41. 0.377 56.630 ↓ 142.0 142 1

Nested Loop Left Join (cost=5.35..4,635.58 rows=1 width=821) (actual time=32.269..56.630 rows=142 loops=1)

  • Index Cond: ((cid = ra_1.cid) AND (cid = 12,876) AND (id = ra_1.ar_origin_reference_id))
42. 0.444 56.253 ↓ 142.0 142 1

Nested Loop Left Join (cost=4.93..4,634.97 rows=1 width=821) (actual time=32.256..56.253 rows=142 loops=1)

  • Join Filter: (cet_1.default_calendar_event_type_id = 12)
43. 0.283 55.809 ↓ 142.0 142 1

Nested Loop (cost=4.64..4,633.87 rows=1 width=813) (actual time=32.250..55.809 rows=142 loops=1)

44. 13.827 55.526 ↓ 142.0 142 1

Nested Loop (cost=4.50..4,633.66 rows=1 width=366) (actual time=32.233..55.526 rows=142 loops=1)

45. 41.199 41.699 ↓ 5,080.0 5,080 1

Nested Loop (cost=4.08..4,631.93 rows=1 width=31) (actual time=5.242..41.699 rows=5,080 loops=1)

  • Join Filter: (cea_1.property_id = cuc_1.calendar_property_id)
  • Rows Removed by Join Filter: 5,080
46. 0.358 0.358 ↓ 2.0 2 1

Index Scan using pk_company_user_calendars on company_user_calendars cuc_1 (cost=0.28..119.81 rows=1 width=19) (actual time=0.352..0.358 rows=2 loops=1)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = 5,444)
  • Rows Removed by Filter: 923
47. 0.142 0.142 ↑ 320.0 1 142

Hash Join (cost=3.79..4,501.71 rows=320 width=16) (actual time=0.001..0.001 rows=1 loops=142)

48. 0.426 0.426 ↑ 1.0 1 142

Index Scan using pk_cached_leases on cached_leases cl_1 (cost=0.42..2.19 rows=1 width=13) (actual time=0.003..0.003 rows=1 loops=142)

  • Index Cond: ((cev_1.cid = cid) AND (cid = 12,876) AND (id = cev_1.lease_id))
49. 0.284 0.284 ↑ 1.0 1 142

Index Only Scan using idx_properties_cid_id_property_name on properties p (cost=0.27..0.32 rows=1 width=29) (actual time=0.002..0.002 rows=1 loops=142)

  • Index Cond: ((cid = 12,876) AND (id = cea_1.property_id))
  • Heap Fetches: 127
50. 0.142 0.142 ↓ 0.0 0 142

Index Scan using idx_events_id on events e_1 (cost=0.56..2.61 rows=1 width=273) (actual time=0.001..0.001 rows=0 loops=142)

  • Index Cond: (cev_1.event_id = id)
  • Filter: ((cid = 12,876) AND (cev_1.cid = cid))
51. 0.031 1,112.605 ↓ 8.0 8 1

Subquery Scan on *SELECT* 3 (cost=2.37..9,066.46 rows=1 width=356) (actual time=355.651..1,112.605 rows=8 loops=1)

52. 0.943 1,112.574 ↓ 8.0 8 1

Nested Loop (cost=2.37..9,066.42 rows=1 width=338) (actual time=355.645..1,112.574 rows=8 loops=1)

  • Join Filter: (cl_2.property_id = lp_1.property_id)
  • Rows Removed by Join Filter: 8
53. 0.474 1,109.279 ↓ 8.0 8 1

Nested Loop Left Join (cost=2.12..9,062.78 rows=1 width=732) (actual time=353.214..1,109.279 rows=8 loops=1)

  • Join Filter: ((ca.application_stage_id = ass.application_stage_id) AND (ca.application_status_id = ass.application_status_id) AND (ca.lease_interval_type_id = ass.lease_interval_type_id))
  • Rows Removed by Join Filter: 1,943
  • Filter: ((cl_2.lease_status_type_id = ANY ('{4,5}'::integer[])) OR ((cl_2.lease_status_type_id = ANY ('{1,3,4,5,6}'::integer[])) AND (cl_2.is_transferring_in = 1)) OR ((cl_2.property_id = 219,045) AND (ass.id = 18)) OR ((cl_2.property_id = 652,294) AND (ass.id = 18)))
  • Rows Removed by Filter: 21
54. 0.128 1,107.877 ↓ 29.0 29 1

Nested Loop Left Join (cost=2.12..9,039.74 rows=1 width=752) (actual time=32.703..1,107.877 rows=29 loops=1)

  • Join Filter: (cev_2.calendar_event_type_id = cet_2.id)
  • Filter: (cev_2.id IS NULL)
55. 0.078 6.735 ↓ 29.0 29 1

Nested Loop Left Join (cost=1.70..134.00 rows=1 width=559) (actual time=0.565..6.735 rows=29 loops=1)

56. 0.202 6.309 ↓ 29.0 29 1

Nested Loop (cost=1.27..131.50 rows=1 width=551) (actual time=0.550..6.309 rows=29 loops=1)

57. 0.114 5.556 ↓ 29.0 29 1

Nested Loop (cost=1.13..126.27 rows=1 width=92) (actual time=0.536..5.556 rows=29 loops=1)

58. 0.060 5.112 ↓ 30.0 30 1

Nested Loop (cost=0.70..123.77 rows=1 width=92) (actual time=0.520..5.112 rows=30 loops=1)

59. 0.370 0.370 ↓ 2.0 2 1

Index Scan using pk_company_user_calendars on company_user_calendars cuc_2 (cost=0.28..119.81 rows=1 width=23) (actual time=0.363..0.370 rows=2 loops=1)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = 5,444)
  • Rows Removed by Filter: 923
60. 4.682 4.682 ↓ 15.0 15 2

Index Scan using idx_cached_leases_cid_property_id on cached_leases cl_2 (cost=0.42..3.93 rows=1 width=73) (actual time=0.095..2.341 rows=15 loops=2)

  • Index Cond: ((cid = 12,876) AND (property_id = cuc_2.calendar_property_id) AND (property_id = ANY ('{219045,652294}'::integer[])))
  • Filter: ((move_in_date IS NOT NULL) AND (move_in_date >= '09/27/2020'::date) AND (move_in_date <= '10/04/2020'::date) AND (lease_status_type_id = ANY ('{1,3,4,5,6}'::integer[])))
  • Rows Removed by Filter: 2,282
61. 0.330 0.330 ↑ 1.0 1 30

Index Scan using idx_lease_customers_customer_id on lease_customers lc (cost=0.42..2.47 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=30)

  • Index Cond: (customer_id = cl_2.primary_customer_id)
  • Filter: ((cid = 12,876) AND (cl_2.id = lease_id))
  • Rows Removed by Filter: 0
62. 0.551 0.551 ↑ 1.0 1 29

Index Scan using pk_calendar_event_types on calendar_event_types cet_2 (cost=0.14..5.20 rows=1 width=463) (actual time=0.004..0.019 rows=1 loops=29)

  • Index Cond: ((cid = 12,876) AND (id = ANY ('{3931,3930,3932,5310,3933,3934,3936,3935,3938,8496,3937,8509,4935,4934}'::integer[])))
  • Filter: (default_calendar_event_type_id = 4)
  • Rows Removed by Filter: 13
63. 0.348 0.348 ↑ 1.0 1 29

Index Scan using idx_cached_applications_lease_interval_id on cached_applications ca (cost=0.43..2.47 rows=1 width=20) (actual time=0.010..0.012 rows=1 loops=29)

  • Index Cond: (lease_interval_id = cl_2.active_lease_interval_id)
  • Filter: ((cid = 12,876) AND (cid = cl_2.cid))
64. 1,101.014 1,101.014 ↓ 0.0 0 29

Index Scan using pk_calendar_events on calendar_events cev_2 (cost=0.42..8,905.58 rows=5 width=205) (actual time=37.966..37.966 rows=0 loops=29)

  • Index Cond: ((cid = cl_2.cid) AND (cid = 12,876))
  • Filter: ((deleted_on IS NULL) AND (lease_id = cl_2.id))
  • Rows Removed by Filter: 56,804
65. 0.928 0.928 ↑ 1.0 68 29

Seq Scan on application_stage_statuses ass (cost=0.00..19.04 rows=68 width=16) (actual time=0.003..0.032 rows=68 loops=29)

66. 2.352 2.352 ↑ 25.0 2 8

Function Scan on load_properties lp_1 (cost=0.25..1.75 rows=50 width=4) (actual time=0.294..0.294 rows=2 loops=8)

  • Filter: (property_id IS NOT NULL)
67. 0.033 313.912 ↓ 9.0 9 1

Subquery Scan on *SELECT* 4 (cost=1.94..9,040.91 rows=1 width=356) (actual time=39.382..313.912 rows=9 loops=1)

68. 1.041 313.879 ↓ 9.0 9 1

Nested Loop (cost=1.94..9,040.87 rows=1 width=338) (actual time=39.378..313.879 rows=9 loops=1)

  • Join Filter: (cl_3.property_id = lp_2.property_id)
  • Rows Removed by Join Filter: 9
69. 0.046 308.617 ↓ 9.0 9 1

Nested Loop Left Join (cost=1.69..9,037.23 rows=1 width=732) (actual time=35.062..308.617 rows=9 loops=1)

  • Join Filter: (cev_3.calendar_event_type_id = cet_3.id)
  • Rows Removed by Join Filter: 35
  • Filter: (cev_3.id IS NULL)
70. 0.083 5.145 ↓ 9.0 9 1

Nested Loop (cost=1.27..131.48 rows=1 width=539) (actual time=0.434..5.145 rows=9 loops=1)

71. 0.039 4.882 ↓ 9.0 9 1

Nested Loop (cost=1.13..126.25 rows=1 width=80) (actual time=0.411..4.882 rows=9 loops=1)

72. 0.025 4.744 ↓ 9.0 9 1

Nested Loop (cost=0.70..123.75 rows=1 width=80) (actual time=0.398..4.744 rows=9 loops=1)

73. 0.355 0.355 ↓ 2.0 2 1

Index Scan using pk_company_user_calendars on company_user_calendars cuc_3 (cost=0.28..119.81 rows=1 width=23) (actual time=0.350..0.355 rows=2 loops=1)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = 5,444)
  • Rows Removed by Filter: 923
74. 4.364 4.364 ↓ 4.0 4 2

Index Scan using idx_cached_leases_cid_property_id on cached_leases cl_3 (cost=0.42..3.91 rows=1 width=61) (actual time=0.247..2.182 rows=4 loops=2)

  • Index Cond: ((cid = 12,876) AND (property_id = cuc_3.calendar_property_id) AND (property_id = ANY ('{219045,652294}'::integer[])))
  • Filter: ((move_out_date IS NOT NULL) AND (move_out_date >= '09/27/2020'::date) AND (move_out_date <= '10/04/2020'::date) AND (lease_status_type_id = ANY ('{1,3,4,5,6}'::integer[])))
  • Rows Removed by Filter: 2,292
75. 0.099 0.099 ↑ 1.0 1 9

Index Scan using idx_lease_customers_customer_id on lease_customers lc_1 (cost=0.42..2.47 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=9)

  • Index Cond: (customer_id = cl_3.primary_customer_id)
  • Filter: ((cid = 12,876) AND (cl_3.id = lease_id))
76. 0.180 0.180 ↑ 1.0 1 9

Index Scan using pk_calendar_event_types on calendar_event_types cet_3 (cost=0.14..5.20 rows=1 width=463) (actual time=0.006..0.020 rows=1 loops=9)

  • Index Cond: ((cid = 12,876) AND (id = ANY ('{3931,3930,3932,5310,3933,3934,3936,3935,3938,8496,3937,8509,4935,4934}'::integer[])))
  • Filter: (default_calendar_event_type_id = 5)
  • Rows Removed by Filter: 13
77. 303.426 303.426 ↑ 1.2 4 9

Index Scan using pk_calendar_events on calendar_events cev_3 (cost=0.42..8,905.58 rows=5 width=205) (actual time=31.562..33.714 rows=4 loops=9)

  • Index Cond: ((cid = cl_3.cid) AND (cid = 12,876))
  • Filter: ((deleted_on IS NULL) AND (lease_id = cl_3.id))
  • Rows Removed by Filter: 56,800
78. 4.221 4.221 ↑ 25.0 2 9

Function Scan on load_properties lp_2 (cost=0.25..1.75 rows=50 width=4) (actual time=0.469..0.469 rows=2 loops=9)

  • Filter: (property_id IS NOT NULL)
79. 0.003 187,992.383 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=2.22..2,609.32 rows=1 width=383) (actual time=187,992.373..187,992.383 rows=0 loops=1)

80. 18.265 187,992.380 ↓ 0.0 0 1

Nested Loop (cost=2.22..2,609.29 rows=1 width=372) (actual time=187,992.371..187,992.380 rows=0 loops=1)

81. 19.827 187,851.769 ↓ 6,797.0 6,797 1

Nested Loop (cost=1.80..2,606.36 rows=1 width=700) (actual time=26.938..187,851.769 rows=6,797 loops=1)

  • Join Filter: (cmr.property_id = lp_3.property_id)
  • Rows Removed by Join Filter: 6,797
82. 19.161 187,825.145 ↓ 6,797.0 6,797 1

Nested Loop Left Join (cost=1.55..2,602.98 rows=1 width=708) (actual time=23.176..187,825.145 rows=6,797 loops=1)

  • Join Filter: (cev_4.calendar_event_type_id = cet_4.id)
  • Filter: (cev_4.id IS NULL)
  • Rows Removed by Filter: 518
83. 46.735 220.124 ↓ 7,315.0 7,315 1

Nested Loop (cost=1.13..192.92 rows=1 width=515) (actual time=0.419..220.124 rows=7,315 loops=1)

84. 5.130 56.349 ↓ 7,315.0 7,315 1

Nested Loop (cost=0.98..187.68 rows=1 width=56) (actual time=0.392..56.349 rows=7,315 loops=1)

85. 0.009 0.381 ↓ 2.0 2 1

Nested Loop (cost=0.55..122.18 rows=1 width=52) (actual time=0.365..0.381 rows=2 loops=1)

86. 0.358 0.358 ↓ 2.0 2 1

Index Scan using pk_company_user_calendars on company_user_calendars cuc_4 (cost=0.28..119.81 rows=1 width=23) (actual time=0.352..0.358 rows=2 loops=1)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = 5,444)
  • Rows Removed by Filter: 923
87. 0.014 0.014 ↑ 1.0 1 2

Index Scan using idx_properties_id on properties p_1 (cost=0.27..2.31 rows=1 width=29) (actual time=0.007..0.007 rows=1 loops=2)

  • Index Cond: (id = cuc_4.calendar_property_id)
  • Filter: (cid = 12,876)
88. 50.838 50.838 ↓ 1,219.3 3,658 2

Index Scan using idx_maintenance_requests_property_id on maintenance_requests cmr (cost=0.43..65.42 rows=3 width=12) (actual time=0.026..25.419 rows=3,658 loops=2)

  • Index Cond: ((property_id = p_1.id) AND (property_id = ANY ('{219045,652294}'::integer[])))
  • Filter: ((parent_maintenance_request_id IS NULL) AND (deleted_on IS NULL) AND (deleted_by IS NULL) AND (cid = 12,876))
  • Rows Removed by Filter: 4,047
89. 117.040 117.040 ↑ 1.0 1 7,315

Index Scan using pk_calendar_event_types on calendar_event_types cet_4 (cost=0.14..5.20 rows=1 width=463) (actual time=0.008..0.016 rows=1 loops=7,315)

  • Index Cond: ((cid = 12,876) AND (id = ANY ('{3931,3930,3932,5310,3933,3934,3936,3935,3938,8496,3937,8509,4935,4934}'::integer[])))
  • Filter: (default_calendar_event_type_id = 9)
  • Rows Removed by Filter: 13
90. 187,585.860 187,585.860 ↓ 0.0 0 7,315

Index Scan using pk_calendar_events on calendar_events cev_4 (cost=0.42..2,410.03 rows=1 width=205) (actual time=24.928..25.644 rows=0 loops=7,315)

  • Index Cond: ((cid = cmr.cid) AND (cid = 12,876))
  • Filter: ((deleted_on IS NULL) AND (reference_id = cmr.id))
  • Rows Removed by Filter: 56,804
91. 6.797 6.797 ↑ 25.0 2 6,797

Function Scan on load_properties lp_3 (cost=0.25..1.75 rows=50 width=4) (actual time=0.001..0.001 rows=2 loops=6,797)

  • Filter: (property_id IS NOT NULL)
92. 122.346 122.346 ↓ 0.0 0 6,797

Index Scan using idx_maintenance_request_details_maintenance_request_id on maintenance_request_details mrd (cost=0.43..2.39 rows=1 width=52) (actual time=0.018..0.018 rows=0 loops=6,797)

  • Index Cond: (maintenance_request_id = cmr.id)
  • Filter: ((requested_datetime IS NOT NULL) AND (requested_datetime >= '09/27/2020 00:00:00'::timestamp without time zone) AND (requested_datetime <= '10/04/2020 00:00:00'::timestamp without time zone) AND (cid = 12,876) AND (date_part('hour'::text, requested_datetime) >= '0'::double precision) AND (date_part('hour'::text, requested_datetime) <= '11'::double precision))
  • Rows Removed by Filter: 1
93. 0.002 181,939.685 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6 (cost=2.22..2,609.32 rows=1 width=383) (actual time=181,939.681..181,939.685 rows=0 loops=1)

94. 16.103 181,939.683 ↓ 0.0 0 1

Nested Loop (cost=2.22..2,609.29 rows=1 width=372) (actual time=181,939.680..181,939.683 rows=0 loops=1)

95. 17.089 181,767.249 ↓ 6,797.0 6,797 1

Nested Loop (cost=1.80..2,606.36 rows=1 width=700) (actual time=26.281..181,767.249 rows=6,797 loops=1)

  • Join Filter: (cmr_1.property_id = lp_4.property_id)
  • Rows Removed by Join Filter: 6,797
96. 22.597 181,743.363 ↓ 6,797.0 6,797 1

Nested Loop Left Join (cost=1.55..2,602.98 rows=1 width=708) (actual time=23.660..181,743.363 rows=6,797 loops=1)

  • Join Filter: (cev_5.calendar_event_type_id = cet_5.id)
  • Filter: (cev_5.id IS NULL)
  • Rows Removed by Filter: 518
97. 0.000 199.041 ↓ 7,315.0 7,315 1

Nested Loop (cost=1.13..192.92 rows=1 width=515) (actual time=0.437..199.041 rows=7,315 loops=1)

98. 5.637 38.345 ↓ 7,315.0 7,315 1

Nested Loop (cost=0.98..187.68 rows=1 width=56) (actual time=0.423..38.345 rows=7,315 loops=1)

99. 0.008 0.402 ↓ 2.0 2 1

Nested Loop (cost=0.55..122.18 rows=1 width=52) (actual time=0.381..0.402 rows=2 loops=1)

100. 0.378 0.378 ↓ 2.0 2 1

Index Scan using pk_company_user_calendars on company_user_calendars cuc_5 (cost=0.28..119.81 rows=1 width=23) (actual time=0.371..0.378 rows=2 loops=1)

  • Index Cond: (cid = 12,876)
  • Filter: (company_user_id = 5,444)
  • Rows Removed by Filter: 923
101. 0.016 0.016 ↑ 1.0 1 2

Index Scan using idx_properties_id on properties p_2 (cost=0.27..2.31 rows=1 width=29) (actual time=0.008..0.008 rows=1 loops=2)

  • Index Cond: (id = cuc_5.calendar_property_id)
  • Filter: (cid = 12,876)
102. 32.306 32.306 ↓ 1,219.3 3,658 2

Index Scan using idx_maintenance_requests_property_id on maintenance_requests cmr_1 (cost=0.43..65.42 rows=3 width=12) (actual time=0.032..16.153 rows=3,658 loops=2)

  • Index Cond: ((property_id = p_2.id) AND (property_id = ANY ('{219045,652294}'::integer[])))
  • Filter: ((parent_maintenance_request_id IS NULL) AND (deleted_on IS NULL) AND (deleted_by IS NULL) AND (cid = 12,876))
  • Rows Removed by Filter: 4,047
103. 84.734 117.040 ↑ 1.0 1 7,315

Index Scan using pk_calendar_event_types on calendar_event_types cet_5 (cost=0.14..5.20 rows=1 width=463) (actual time=0.008..0.016 rows=1 loops=7,315)

  • Index Cond: (id = cuc_5.calendar_property_id)
  • Filter: (cid = 12,876)
104. 32.306 32.306 ↓ 1,219.3 3,658 2

Index Scan using idx_maintenance_requests_property_id on maintenance_requests cmr_1 (cost=0.43..65.42 rows=3 width=12) (actual time=0.032..16.153 rows=3,658 loops=2)

  • Index Cond: ((property_id = p_2.id) AND (property_id = ANY ('{219045,652294}'::integer[])))
  • Filter: ((parent_maintenance_request_id IS NULL) AND (deleted_on IS NULL) AND (deleted_by IS NULL) AND (cid = 12,876))
  • Rows Removed by Filter: 4,047
105. 117.040 117.040 ↑ 1.0 1 7,315

Index Scan using pk_calendar_event_types on calendar_event_types cet_5 (cost=0.14..5.20 rows=1 width=463) (actual time=0.008..0.016 rows=1 loops=7,315)

  • Index Cond: ((cid = 12,876) AND (id = ANY ('{3931,3930,3932,5310,3933,3934,3936,3935,3938,8496,3937,8509,4935,4934}'::integer[])))
  • Filter: (default_calendar_event_type_id = 9)
  • Rows Removed by Filter: 13
106. 181,521.725 181,521.725 ↓ 0.0 0 7,315

Index Scan using pk_calendar_events on calendar_events cev_5 (cost=0.42..2,410.03 rows=1 width=205) (actual time=24.114..24.815 rows=0 loops=7,315)

  • Index Cond: ((cid = cmr_1.cid) AND (cid = 12,876))
  • Filter: ((deleted_on IS NULL) AND (reference_id = cmr_1.id))
  • Rows Removed by Filter: 56,804
107. 6.797 6.797 ↑ 25.0 2 6,797

Function Scan on load_properties lp_4 (cost=0.25..1.75 rows=50 width=4) (actual time=0.001..0.001 rows=2 loops=6,797)

  • Filter: (property_id IS NOT NULL)
108. 156.331 156.331 ↓ 0.0 0 6,797

Index Scan using idx_maintenance_request_details_maintenance_request_id on maintenance_request_details mrd_1 (cost=0.43..2.39 rows=1 width=52) (actual time=0.023..0.023 rows=0 loops=6,797)

  • Index Cond: (maintenance_request_id = cmr_1.id)
  • Filter: ((requested_datetime IS NOT NULL) AND (requested_datetime >= '09/27/2020 00:00:00'::timestamp without time zone) AND (requested_datetime <= '10/04/2020 00:00:00'::timestamp without time zone) AND (cid = 12,876) AND (date_part('hour'::text, requested_datetime) > '11'::double precision) AND (date_part('hour'::text, requested_datetime) <= '23'::double precision))
  • Rows Removed by Filter: 1
Planning time : 43.927 ms
Execution time : 371,453.775 ms