explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DchQ

Settings
# exclusive inclusive rows x rows loops node
1. 6,193.226 12,106.843 ↓ 53,863.0 53,863 1

Result (cost=9,913.57..9,921.66 rows=1 width=1,287) (actual time=5,810.249..12,106.843 rows=53,863 loops=1)

2. 377.503 5,913.617 ↓ 53,863.0 53,863 1

Sort (cost=9,913.57..9,913.57 rows=1 width=6,210) (actual time=5,808.673..5,913.617 rows=53,863 loops=1)

  • Sort Key: p.property_name, (CASE WHEN (mr.property_building_id IS NOT NULL) THEN mr.property_building_id ELSE NULL::integer END), (CASE WHEN ((COALESCE(mrd.unit_number, ''::character varying))::text <> ''::text) THEN mrd.unit_number ELSE NULL::character varying END), pu.unit_number, us.unit_number_cache
  • Sort Method: external merge Disk: 48432kB
3. 86.110 5,536.114 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,310.10..9,913.56 rows=1 width=6,210) (actual time=18.918..5,536.114 rows=53,863 loops=1)

4. 41.750 5,342.278 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,293.59..9,896.97 rows=1 width=6,165) (actual time=18.864..5,342.278 rows=53,863 loops=1)

5. 32.278 5,138.939 ↓ 53,863.0 53,863 1

Nested Loop (cost=8,293.16..9,890.21 rows=1 width=6,165) (actual time=18.832..5,138.939 rows=53,863 loops=1)

6. 39.334 5,052.798 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,293.03..9,889.85 rows=1 width=6,165) (actual time=18.798..5,052.798 rows=53,863 loops=1)

7. 14.075 4,905.738 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,292.62..9,882.49 rows=1 width=6,168) (actual time=18.776..4,905.738 rows=53,863 loops=1)

8. 35.070 4,730.074 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,271.38..9,861.23 rows=1 width=6,160) (actual time=18.754..4,730.074 rows=53,863 loops=1)

9. 44.141 4,695.004 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,271.09..9,855.92 rows=1 width=6,150) (actual time=18.749..4,695.004 rows=53,863 loops=1)

10. 38.290 4,543.137 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,262.77..9,847.57 rows=1 width=5,998) (actual time=18.719..4,543.137 rows=53,863 loops=1)

11. 11.458 4,450.984 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,262.50..9,844.28 rows=1 width=5,846) (actual time=18.702..4,450.984 rows=53,863 loops=1)

12. 47.319 4,385.663 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,262.22..9,843.95 rows=1 width=5,705) (actual time=18.682..4,385.663 rows=53,863 loops=1)

13. 26.642 4,338.344 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,262.08..9,843.80 rows=1 width=5,591) (actual time=18.665..4,338.344 rows=53,863 loops=1)

14. 18.301 4,257.839 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,261.67..9,836.33 rows=1 width=5,577) (actual time=18.642..4,257.839 rows=53,863 loops=1)

15. 35.990 4,185.675 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,261.38..9,833.29 rows=1 width=5,420) (actual time=18.618..4,185.675 rows=53,863 loops=1)

16. 62.115 4,041.959 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,261.09..9,826.16 rows=1 width=5,217) (actual time=18.594..4,041.959 rows=53,863 loops=1)

17. 1,025.556 3,925.981 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,260.81..9,821.97 rows=1 width=5,196) (actual time=18.582..3,925.981 rows=53,863 loops=1)

  • Join Filter: ((work_order_labors_cost.cid = mr.cid) AND (work_order_labors_cost.maintenance_request_id = mr.id))
  • Rows Removed by Join Filter: 15404550
18. 153.773 1,446.124 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,260.81..9,812.10 rows=1 width=5,164) (actual time=18.528..1,446.124 rows=53,863 loops=1)

  • Join Filter: ((work_order_materials_cost.cid = mr.cid) AND (work_order_materials_cost.maintenance_request_id = mr.id))
  • Rows Removed by Join Filter: 1562012
19. 39.667 1,130.762 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,260.81..9,810.30 rows=1 width=5,132) (actual time=18.513..1,130.762 rows=53,863 loops=1)

20. 40.696 1,091.095 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,260.39..9,803.58 rows=1 width=5,119) (actual time=18.490..1,091.095 rows=53,863 loops=1)

21. 53.191 1,050.399 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,260.10..9,800.20 rows=1 width=5,102) (actual time=18.466..1,050.399 rows=53,863 loops=1)

22. 51.437 943.345 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,259.83..9,798.43 rows=1 width=4,478) (actual time=18.445..943.345 rows=53,863 loops=1)

23. 41.762 838.045 ↓ 53,863.0 53,863 1

Nested Loop Left Join (cost=8,259.55..9,795.19 rows=1 width=3,571) (actual time=18.423..838.045 rows=53,863 loops=1)

  • Join Filter: (mp2.cid = mr.cid)
24. 50.960 796.283 ↓ 53,863.0 53,863 1

Nested Loop (cost=8,259.26..9,793.30 rows=1 width=2,918) (actual time=18.417..796.283 rows=53,863 loops=1)

25. 30.585 691.460 ↓ 26,931.5 53,863 1

Nested Loop Left Join (cost=8,258.99..9,789.58 rows=2 width=2,247) (actual time=18.394..691.460 rows=53,863 loops=1)

26. 53.343 660.875 ↓ 26,931.5 53,863 1

Nested Loop Left Join (cost=8,258.70..9,779.10 rows=2 width=1,594) (actual time=18.389..660.875 rows=53,863 loops=1)

27. 48.525 607.532 ↓ 26,931.5 53,863 1

Nested Loop Left Join (cost=8,258.41..9,768.61 rows=2 width=937) (actual time=18.364..607.532 rows=53,863 loops=1)

  • Join Filter: (c.primary_phone_number_type_id IS NULL)
  • Rows Removed by Join Filter: 1529
28. 15.084 559.007 ↓ 26,931.5 53,863 1

Nested Loop Left Join (cost=8,258.13..9,761.15 rows=2 width=926) (actual time=18.347..559.007 rows=53,863 loops=1)

29. 33.203 490.060 ↓ 26,931.5 53,863 1

Nested Loop (cost=8,257.71..9,745.45 rows=2 width=853) (actual time=18.313..490.060 rows=53,863 loops=1)

30. 60.596 402.666 ↓ 27,095.5 54,191 1

Nested Loop (cost=8,257.43..9,741.47 rows=2 width=830) (actual time=18.298..402.666 rows=54,191 loops=1)

31. 41.957 118.372 ↓ 1,271.0 111,849 1

Hash Join (cost=8,257.00..8,998.55 rows=88 width=206) (actual time=18.222..118.372 rows=111,849 loops=1)

  • Hash Cond: (mr.maintenance_request_type_id = mrt.id)
  • Join Filter: CASE WHEN (mr.parent_maintenance_request_id IS NOT NULL) THEN (mrt.id = ANY ('{2,1,0,5}'::integer[])) ELSE (mrt.id = ANY ('{3,2,1,5}'::integer[])) END
  • Rows Removed by Join Filter: 5542
32. 58.499 76.395 ↓ 667.0 117,391 1

Bitmap Heap Scan on maintenance_requests mr (cost=8,255.88..8,996.59 rows=176 width=92) (actual time=18.192..76.395 rows=117,391 loops=1)

  • Recheck Cond: ((cid = 2138) AND (maintenance_status_id = ANY ('{15103,15107,15106,15105,15104,18223,18725,18926,18933,19885,21678,21812,22047,22048,22049,22056,22057,22217,22572,23031,23221,23687,23964,68419,68615,68842,69066,69131,69173,69410,69411,69474,69490,69491,69492,69493,69494,69495,69574,69642,69646,112906,112907,112948,113022,113384,113445,114590,114792,114793,114794,114795,114830,115032,115033,115034,115147,115310,115311,115312,115313,115314,115315,115316,115317,115318,115331,115360,115425,115426,115427,115428,115475,115476,115477,115478,115508,115509,116019,116020,115517}'::integer[])) AND (maintenance_priority_id = ANY ('{28087,25090,27467,26317,27160,23774,1028,26169,26170,26198,25993,23940,23874,23752,23753,23942,23676,23780,24676,23890,25135,24883,27468,27479,24874,24873,25772,26309,24871,15295,19346,24872,23769,28387,26310,27161,25933,25935,24870,26201,26171,26277,26324,25201,25200,15294,19419,25743,2448,23960,23891,2021,25951,1630,24675,27910,26518,23765,26524,26526,19422,23478,26525,27469,23771,28912,23762,23772,28915,27909,26523,27901,24884,26521,23766,27904,27905,28903,21528,28048,28049,23773,23761,15296,23767,19345,27907,27900,27903,26519,26520,26522,21006,27908,23763,28367,28902,26202,28908,21529,23768,28904,28913,23764,23775,28042,28911,26172,26199,28907,19421,28043,28050,25934,23776,23777,23778,28901,28914,23779,28046,28051,28047,27906,19193,19344,21536,2344,22693,17960,19194,28044,2067,18878,21160,22272,22504,20776,28905,23373,28906,28909,28910,23941,27902,28045,27470,25525,15297,1825,28857,26197,15298,24882,19420,28040,28858,15299,28041,25542,28683,26200,24869,26975,28802,23882}'::integer[])))
  • Filter: (((deleted_on IS NULL) OR (deleted_on > '2019-12-31 00:00:00+00'::timestamp with time zone)) AND ((created_by = 18) OR (ps_product_id = ANY ('{7,36,1,21981,20612,56,14,8292,46,31693,3,34}'::integer[]))))
  • Rows Removed by Filter: 7680
  • Heap Blocks: exact=2329
33. 0.162 17.896 ↓ 0.0 0 1

BitmapAnd (cost=8,255.88..8,255.88 rows=177 width=0) (actual time=17.896..17.896 rows=0 loops=1)

34. 5.834 5.834 ↓ 1.0 125,071 1

Bitmap Index Scan on pk_maintenance_requests (cost=0.00..2,289.72 rows=123,905 width=0) (actual time=5.834..5.834 rows=125,071 loops=1)

  • Index Cond: (cid = 2138)
35. 5.978 5.978 ↑ 1.1 125,071 1

Bitmap Index Scan on idx_maintenance_requests_maintenance_status_id (cost=0.00..2,700.89 rows=143,175 width=0) (actual time=5.978..5.978 rows=125,071 loops=1)

  • Index Cond: (maintenance_status_id = ANY ('{15103,15107,15106,15105,15104,18223,18725,18926,18933,19885,21678,21812,22047,22048,22049,22056,22057,22217,22572,23031,23221,23687,23964,68419,68615,68842,69066,69131,69173,69410,69411,69474,69490,69491,69492,69493,69494,69495,69574,69642,69646,112906,112907,112948,113022,113384,113445,114590,114792,114793,114794,114795,114830,115032,115033,115034,115147,115310,115311,115312,115313,115314,115315,115316,115317,115318,115331,115360,115425,115426,115427,115428,115475,115476,115477,115478,115508,115509,116019,116020,115517}'::integer[]))
36. 5.922 5.922 ↑ 1.3 125,071 1

Bitmap Index Scan on idx_maintenance_requests_maintenance_priority_id (cost=0.00..3,264.64 rows=165,582 width=0) (actual time=5.922..5.922 rows=125,071 loops=1)

  • Index Cond: (maintenance_priority_id = ANY ('{28087,25090,27467,26317,27160,23774,1028,26169,26170,26198,25993,23940,23874,23752,23753,23942,23676,23780,24676,23890,25135,24883,27468,27479,24874,24873,25772,26309,24871,15295,19346,24872,23769,28387,26310,27161,25933,25935,24870,26201,26171,26277,26324,25201,25200,15294,19419,25743,2448,23960,23891,2021,25951,1630,24675,27910,26518,23765,26524,26526,19422,23478,26525,27469,23771,28912,23762,23772,28915,27909,26523,27901,24884,26521,23766,27904,27905,28903,21528,28048,28049,23773,23761,15296,23767,19345,27907,27900,27903,26519,26520,26522,21006,27908,23763,28367,28902,26202,28908,21529,23768,28904,28913,23764,23775,28042,28911,26172,26199,28907,19421,28043,28050,25934,23776,23777,23778,28901,28914,23779,28046,28051,28047,27906,19193,19344,21536,2344,22693,17960,19194,28044,2067,18878,21160,22272,22504,20776,28905,23373,28906,28909,28910,23941,27902,28045,27470,25525,15297,1825,28857,26197,15298,24882,19420,28040,28858,15299,28041,25542,28683,26200,24869,26975,28802,23882}'::integer[]))
37. 0.004 0.020 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=122) (actual time=0.020..0.020 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
38. 0.016 0.016 ↑ 1.0 5 1

Seq Scan on maintenance_request_types mrt (cost=0.00..1.05 rows=5 width=122) (actual time=0.015..0.016 rows=5 loops=1)

39. 223.698 223.698 ↓ 0.0 0 111,849

Index Scan using idx_maintenance_request_details_maintenance_request_id on maintenance_request_details mrd (cost=0.43..8.43 rows=1 width=632) (actual time=0.002..0.002 rows=0 loops=111,849)

  • Index Cond: (maintenance_request_id = mr.id)
  • Filter: ((actual_start_datetime >= '2019-01-01 00:00:00+00'::timestamp with time zone) AND (actual_start_datetime < '2020-01-01 00:00:00'::timestamp without time zone) AND (cid = 2138))
  • Rows Removed by Filter: 1
40. 54.191 54.191 ↑ 1.0 1 54,191

Index Scan using idx_lp_property_id on lp (cost=0.28..1.98 rows=1 width=23) (actual time=0.001..0.001 rows=1 loops=54,191)

  • Index Cond: (property_id = mr.property_id)
41. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using pk_customers on customers c (cost=0.42..7.85 rows=1 width=81) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.customer_id))
42. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using uk_customer_phone_numbers_cid_customer_id_phone_number_type_id on customer_phone_numbers cpn (cost=0.29..3.72 rows=1 width=19) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (customer_id = mr.customer_id))
  • Filter: (phone_number_type_id <> 1)
43. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using pk_maintenance_problems on maintenance_problems mp (cost=0.29..5.24 rows=1 width=673) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.maintenance_problem_id))
44. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using pk_maintenance_problems on maintenance_problems mp1 (cost=0.29..5.24 rows=1 width=665) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.sub_maintenance_problem_id))
45. 53.863 53.863 ↑ 1.0 1 53,863

Index Scan using pk_maintenance_statuses on maintenance_statuses mst (cost=0.28..1.84 rows=1 width=683) (actual time=0.001..0.001 rows=1 loops=53,863)

  • Index Cond: ((cid = 2138) AND (id = mr.maintenance_status_id))
46. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using pk_maintenance_problems on maintenance_problems mp2 (cost=0.29..1.87 rows=1 width=665) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: ((cid = 2138) AND (id = mp.maintenance_problem_id))
47. 53.863 53.863 ↑ 1.0 1 53,863

Index Scan using pk_maintenance_locations on maintenance_locations ml (cost=0.28..3.21 rows=1 width=915) (actual time=0.001..0.001 rows=1 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.maintenance_location_id))
48. 53.863 53.863 ↑ 1.0 1 53,863

Index Scan using pk_maintenance_priorities on maintenance_priorities mpr (cost=0.28..1.75 rows=1 width=632) (actual time=0.001..0.001 rows=1 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.maintenance_priority_id))
49. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using pk_company_employees on company_employees ce (cost=0.29..3.38 rows=1 width=21) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.company_employee_id))
50. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using idx_company_users_cid_company_employee_id on company_users cu (cost=0.42..6.72 rows=1 width=29) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: (company_employee_id = ce.id)
  • Filter: ((cid = 2138) AND (company_user_type_id = 2) AND (cid = ce.cid))
51. 161.589 161.589 ↑ 1.0 29 53,863

Seq Scan on work_order_materials_cost (cost=0.00..1.36 rows=29 width=40) (actual time=0.001..0.003 rows=29 loops=53,863)

  • Filter: (cid = 2138)
52. 1,454.301 1,454.301 ↑ 1.0 286 53,863

Seq Scan on work_order_labors_cost (cost=0.00..5.58 rows=286 width=40) (actual time=0.003..0.027 rows=286 loops=53,863)

  • Filter: (cid = 2138)
53. 53.863 53.863 ↑ 1.0 1 53,863

Index Scan using pk_properties on properties p (cost=0.28..4.19 rows=1 width=29) (actual time=0.001..0.001 rows=1 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.property_id))
54. 107.726 107.726 ↑ 1.0 1 53,863

Index Scan using pk_property_units on property_units pu (cost=0.29..7.13 rows=1 width=211) (actual time=0.002..0.002 rows=1 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.property_unit_id))
55. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using pk_property_buildings on property_buildings pb (cost=0.28..3.03 rows=1 width=169) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = COALESCE(mr.property_building_id, pu.property_building_id)))
56. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using pk_unit_spaces on unit_spaces us (cost=0.42..7.47 rows=1 width=22) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.unit_space_id))
  • Filter: ((deleted_on IS NULL) OR (deleted_on > '2019-12-31 00:00:00+00'::timestamp with time zone))
57. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using pk_unit_space_status_types on unit_space_status_types usst (cost=0.13..0.15 rows=1 width=122) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: (id = us.unit_space_status_type_id)
58. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using pk_unit_types on unit_types ut (cost=0.28..0.33 rows=1 width=161) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: ((cid = us.cid) AND (cid = 2138) AND (id = COALESCE(pu.unit_type_id, us.unit_type_id)))
59. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using unq_idx_maintenance_request_notes_is_closing_note on maintenance_request_notes (cost=0.28..3.28 rows=1 width=160) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = mr.cid) AND (cid = 2138) AND (maintenance_request_id = mr.id) AND (maintenance_request_id = mr.id))
60. 0.000 107.726 ↓ 0.0 0 53,863

Subquery Scan on mrn_internal (cost=8.32..8.34 rows=1 width=160) (actual time=0.002..0.002 rows=0 loops=53,863)

  • Filter: ((mrn_internal.cid = 2138) AND (mrn_internal.cid = mr.cid) AND (mrn_internal.maintenance_request_id = mr.id))
61. 0.000 107.726 ↓ 0.0 0 53,863

Limit (cost=8.32..8.32 rows=1 width=164) (actual time=0.002..0.002 rows=0 loops=53,863)

62. 53.863 107.726 ↓ 0.0 0 53,863

Sort (cost=8.32..8.32 rows=1 width=164) (actual time=0.002..0.002 rows=0 loops=53,863)

  • Sort Key: maintenance_request_notes_1.id DESC
  • Sort Method: quicksort Memory: 25kB
63. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using idx_maintenance_request_notes_maintenance_request_id on maintenance_request_notes maintenance_request_notes_1 (cost=0.29..8.31 rows=1 width=164) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: (maintenance_request_id = mr.id)
  • Filter: ((NOT is_closing_note) AND (is_resident_visible <> 1) AND (cid = mr.cid))
  • Rows Removed by Filter: 0
64. 0.000 0.000 ↓ 0.0 0 53,863

Index Scan using pk_ap_payees on ap_payees ap (cost=0.29..5.31 rows=1 width=22) (actual time=0.000..0.000 rows=0 loops=53,863)

  • Index Cond: ((cid = mr.cid) AND (cid = 2138) AND (id = mr.ap_payee_id))
65. 0.000 161.589 ↓ 0.0 0 53,863

Limit (cost=21.24..21.24 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=53,863)

66. 107.726 161.589 ↓ 0.0 0 53,863

Sort (cost=21.24..21.24 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=53,863)

  • Sort Key: maintenance_request_labors.id
  • Sort Method: quicksort Memory: 25kB
67. 0.000 53.863 ↓ 0.0 0 53,863

Bitmap Heap Scan on maintenance_request_labors (cost=4.32..21.23 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Recheck Cond: (mr.id = maintenance_request_id)
  • Filter: (mr.cid = cid)
  • Heap Blocks: exact=320
68. 53.863 53.863 ↓ 0.0 0 53,863

Bitmap Index Scan on idx_maintenance_request_labors_maintenance_request_id (cost=0.00..4.32 rows=5 width=0) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: (maintenance_request_id = mr.id)
69. 107.726 107.726 ↑ 1.0 1 53,863

Index Scan using uk_property_maintenance_priorities_property_id_maintenance_prio on property_maintenance_priorities pmp (cost=0.42..7.35 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=53,863)

  • Index Cond: ((property_id = mr.property_id) AND (maintenance_priority_id = mr.maintenance_priority_id) AND (cid = mr.cid) AND (cid = mr.cid) AND (cid = 2138))
70. 53.863 53.863 ↑ 1.0 1 53,863

Index Only Scan using pk_maintenance_status_types on maintenance_status_types msts (cost=0.13..0.30 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=53,863)

  • Index Cond: (id = mst.maintenance_status_type_id)
  • Heap Fetches: 53863
71. 161.589 161.589 ↑ 1.0 1 53,863

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences pp (cost=0.42..6.69 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=53,863)

  • Index Cond: ((cid = lp.cid) AND (property_id = lp.property_id) AND ((key)::text = 'ENABLE_RESPONSE_TIME'::text))
72. 0.000 107.726 ↓ 0.0 0 53,863

Limit (cost=16.51..16.52 rows=1 width=44) (actual time=0.002..0.002 rows=0 loops=53,863)

73. 53.863 107.726 ↓ 0.0 0 53,863

Sort (cost=16.51..16.52 rows=1 width=44) (actual time=0.002..0.002 rows=0 loops=53,863)

  • Sort Key: et1.event_datetime DESC
  • Sort Method: quicksort Memory: 25kB
74. 0.000 53.863 ↓ 0.0 0 53,863

Nested Loop Left Join (cost=0.43..16.50 rows=1 width=44) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Filter: (((et2.scheduled_end_datetime)::date >= '2019-12-31'::date) OR (et2.scheduled_end_datetime IS NULL))
75. 53.863 53.863 ↓ 0.0 0 53,863

Index Scan using idx_events_property_unit_id on events et1 (cost=0.29..8.31 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=53,863)

  • Index Cond: (property_unit_id = pu.id)
  • Filter: ((notes IS NOT NULL) AND (cid = 2138) AND (event_type_id = 436) AND ((scheduled_datetime)::date < '2020-01-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 0
76. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_events_associated_event_id on events et2 (cost=0.14..8.18 rows=1 width=16) (never executed)

  • Index Cond: (associated_event_id = et1.id)
  • Filter: ((cid = 2138) AND (event_type_id = 436) AND (default_event_result_id = 2) AND (property_unit_id = pu.id) AND (property_unit_id = et1.property_unit_id))