explain.depesz.com

PostgreSQL's explain analyze made readable

Result: te8V

Settings
# exclusive inclusive rows x rows loops node
1. 107,690.645 176,345.451 ↓ 404.3 1,474,198 1

Result (cost=360,825.64..390,312.66 rows=3,646 width=1,287) (actual time=66,080.881..176,345.451 rows=1,474,198 loops=1)

  • Functions: 260
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 27.087 ms, Inlining 0.000 ms, Optimization 14.837 ms, Emission 235.130 ms, Total 277.054 ms"Execution Time: 176742.392 ms
2. 15,340.264 68,654.806 ↓ 404.3 1,474,198 1

Sort (cost=360,825.64..360,834.75 rows=3,646 width=6,210) (actual time=66,080.492..68,654.806 rows=1,474,198 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: 532832kB
3. 1,848.374 53,314.542 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=5,387.17..350,886.94 rows=3,646 width=6,210) (actual time=305.296..53,314.542 rows=1,474,198 loops=1)

4. 617.058 48,517.772 ↓ 404.3 1,474,198 1

Hash Left Join (cost=5,370.66..290,408.91 rows=3,646 width=6,165) (actual time=305.263..48,517.772 rows=1,474,198 loops=1)

  • Hash Cond: ((lp.cid = pp.cid) AND (lp.property_id = pp.property_id))
5. 527.824 47,900.335 ↓ 404.3 1,474,198 1

Hash Join (cost=4,702.19..289,721.31 rows=3,646 width=6,165) (actual time=304.873..47,900.335 rows=1,474,198 loops=1)

  • Hash Cond: (mst.maintenance_status_type_id = msts.id)
6. 675.508 47,118.413 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,701.10..289,700.50 rows=3,646 width=6,165) (actual time=50.766..47,118.413 rows=1,474,198 loops=1)

7. 268.322 43,494.509 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,700.68..288,071.64 rows=3,646 width=6,168) (actual time=50.748..43,494.509 rows=1,474,198 loops=1)

8. 831.572 38,803.593 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,679.45..210,554.32 rows=3,646 width=6,160) (actual time=50.723..38,803.593 rows=1,474,198 loops=1)

9. 906.536 37,972.021 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,679.16..209,421.86 rows=3,646 width=6,150) (actual time=50.717..37,972.021 rows=1,474,198 loops=1)

10. 805.314 34,117.089 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,670.84..178,977.76 rows=3,646 width=5,998) (actual time=50.693..34,117.089 rows=1,474,198 loops=1)

11. 826.854 31,837.577 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,670.57..177,837.53 rows=3,646 width=5,846) (actual time=50.675..31,837.577 rows=1,474,198 loops=1)

12. 452.416 31,010.723 ↓ 404.3 1,474,198 1

Hash Left Join (cost=4,670.28..176,623.24 rows=3,646 width=5,705) (actual time=50.655..31,010.723 rows=1,474,198 loops=1)

  • Hash Cond: (us.unit_space_status_type_id = usst.id)
13. 858.477 30,558.288 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,668.13..176,605.71 rows=3,646 width=5,591) (actual time=50.626..30,558.288 rows=1,474,198 loops=1)

14. 785.814 29,699.811 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,667.71..174,977.72 rows=3,646 width=5,577) (actual time=50.599..29,699.811 rows=1,474,198 loops=1)

15. 409.101 27,439.799 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,667.43..173,805.05 rows=3,646 width=5,420) (actual time=50.573..27,439.799 rows=1,474,198 loops=1)

16. 1,328.086 24,082.302 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,667.13..172,646.02 rows=3,646 width=5,217) (actual time=50.547..24,082.302 rows=1,474,198 loops=1)

17. 488.657 21,280.018 ↓ 404.3 1,474,198 1

Hash Left Join (cost=4,666.85..171,532.59 rows=3,646 width=5,196) (actual time=50.533..21,280.018 rows=1,474,198 loops=1)

  • Hash Cond: ((mr.cid = work_order_labors_cost.cid) AND (mr.id = work_order_labors_cost.maintenance_request_id))
18. 494.404 20,791.278 ↓ 404.3 1,474,198 1

Hash Left Join (cost=4,657.56..171,495.95 rows=3,646 width=5,164) (actual time=50.439..20,791.278 rows=1,474,198 loops=1)

  • Hash Cond: ((mr.cid = work_order_materials_cost.cid) AND (mr.id = work_order_materials_cost.maintenance_request_id))
19. 1,270.776 20,296.845 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,655.00..171,466.03 rows=3,646 width=5,132) (actual time=50.398..20,296.845 rows=1,474,198 loops=1)

20. 1,353.139 17,551.871 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,654.72..170,381.20 rows=3,646 width=4,508) (actual time=50.375..17,551.871 rows=1,474,198 loops=1)

21. 1,380.667 14,724.534 ↓ 404.3 1,474,198 1

Nested Loop Left Join (cost=4,654.44..169,286.67 rows=3,646 width=3,601) (actual time=50.348..14,724.534 rows=1,474,198 loops=1)

  • Join Filter: (mp2.cid = mr.cid)
22. 524.014 13,343.867 ↓ 404.3 1,474,198 1

Hash Left Join (cost=4,654.16..166,253.60 rows=3,646 width=2,948) (actual time=50.340..13,343.867 rows=1,474,198 loops=1)

  • Hash Cond: ((mr.cid = ce.cid) AND (mr.company_employee_id = ce.id))
23. 593.664 12,809.429 ↓ 404.3 1,474,198 1

Hash Join (cost=3,196.58..164,756.28 rows=3,646 width=2,918) (actual time=39.897..12,809.429 rows=1,474,198 loops=1)

  • Hash Cond: (mr.maintenance_status_id = mst.id)
24. 941.840 12,215.428 ↓ 49.9 1,474,198 1

Nested Loop Left Join (cost=3,123.59..164,605.25 rows=29,537 width=2,247) (actual time=39.547..12,215.428 rows=1,474,198 loops=1)

25. 513.203 9,799.390 ↓ 49.9 1,474,198 1

Hash Left Join (cost=3,123.30..155,414.35 rows=29,537 width=1,590) (actual time=39.538..9,799.390 rows=1,474,198 loops=1)

  • Hash Cond: ((mr.cid = cpn.cid) AND (mr.customer_id = cpn.customer_id))
  • Join Filter: (c.primary_phone_number_type_id IS NULL)
  • Rows Removed by Join Filter: 853
26. 823.417 9,284.022 ↓ 49.9 1,474,198 1

Nested Loop Left Join (cost=2,749.37..154,521.55 rows=29,537 width=1,579) (actual time=37.350..9,284.022 rows=1,474,198 loops=1)

27. 1,303.429 8,460.605 ↓ 49.9 1,474,198 1

Nested Loop (cost=2,748.95..141,225.95 rows=29,537 width=1,506) (actual time=37.321..8,460.605 rows=1,474,198 loops=1)

28. 397.085 4,208.510 ↓ 47.9 1,474,333 1

Hash Left Join (cost=2,748.52..124,358.99 rows=30,808 width=882) (actual time=37.283..4,208.510 rows=1,474,333 loops=1)

  • Hash Cond: ((mr.cid = mp1.cid) AND (mr.sub_maintenance_problem_id = mp1.id))
29. 829.537 3,774.283 ↓ 47.9 1,474,333 1

Hash Join (cost=631.72..119,432.45 rows=30,808 width=229) (actual time=0.120..3,774.283 rows=1,474,333 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: 1467517
30. 540.727 2,944.733 ↓ 47.7 2,941,850 1

Nested Loop (cost=630.61..119,139.43 rows=61,615 width=115) (actual time=0.099..2,944.733 rows=2,941,850 loops=1)

31. 0.010 0.010 ↑ 1.0 2 1

Index Scan using idx_lp_property_id on lp (cost=0.13..12.16 rows=2 width=23) (actual time=0.008..0.010 rows=2 loops=1)

32. 2,280.436 2,403.996 ↓ 47.7 1,470,925 2

Bitmap Heap Scan on maintenance_requests mr (cost=630.48..59,255.56 rows=30,808 width=92) (actual time=65.771..1,201.998 rows=1,470,925 loops=2)

  • Recheck Cond: (property_id = lp.property_id)
  • Filter: (((deleted_on IS NULL) OR (deleted_on > '2019-12-31 00:00:00+00'::timestamp with time zone)) AND (cid = 235) AND ((created_by = 18) OR (ps_product_id = ANY ('{7,36,1,21981,20612,56,14,8292,46,31693,3,34}'::integer[]))) AND (maintenance_status_id = ANY ('{114205,114206,114061,114244,114148,113464,114226,114353,25046,2354,114586,114587,113061,19746,113906,114361,114234,112502,22825,2355,13831,113053,114502,113866,15097,114370,15098,18920,14376,15071,2351,113757,113907,68841,114314,113916,114233,113054,2352,113758,113759,113761,114362,113939,114503,113977,113444,2353,112662,113467,113892,113893,113891,113371,113335,14497,113122,113057,113060,69204,113867,113868,114591,114603,114664,114713,114740,114753,114791,114854,114927,114948,115042,115100,115367,115841,115842,115843,115368}'::integer[])) AND (maintenance_priority_id = ANY ('{24875,25741,26074,24879,25358,27538,27540,2020,25457,26089,1398,24989,24210,27486,26663,24861,24961,25798,26327,26080,2394,26121,26101,24899,24795,28771,25652,24793,24877,24876,25721,2376,25456,26361,25186,24867,27539,2352,26600,25509,26291,24796,26602,25641,25629,25740,25423,25508,26599,26290,25650,26179,24862,26459,945,25042,19686,26603,26601,2353,26359,24440,26391,18756,18757,17787,24898,27014,24839,25507,28285,25818,26114,26636,27163,24881,24878,2354,25357,26637,24611,26820,25649,25690,24507,27598,25455,2355,25651,26161,26390,26162,24880,2356,26650,2351,661,24906,24863,24868,25648}'::integer[])))
  • Rows Removed by Filter: 590
  • Heap Blocks: exact=48463
33. 123.560 123.560 ↓ 43.7 1,471,515 2

Bitmap Index Scan on idx_maintenance_requests_property_id (cost=0.00..622.78 rows=33,647 width=0) (actual time=61.780..61.780 rows=1,471,515 loops=2)

  • Index Cond: (property_id = lp.property_id)
34. 0.003 0.013 ↑ 1.0 5 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
35. 0.010 0.010 ↑ 1.0 5 1

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

36. 1.757 37.142 ↑ 1.0 8,494 1

Hash (cost=1,267.39..1,267.39 rows=8,494 width=665) (actual time=37.142..37.142 rows=8,494 loops=1)

  • Buckets: 8192 Batches: 2 Memory Usage: 301kB
37. 35.385 35.385 ↑ 1.0 8,494 1

Seq Scan on maintenance_problems mp1 (cost=0.00..1,267.39 rows=8,494 width=665) (actual time=1.738..35.385 rows=8,494 loops=1)

  • Filter: (cid = 235)
  • Rows Removed by Filter: 10257
38. 2,948.666 2,948.666 ↑ 1.0 1 1,474,333

Index Scan using idx_maintenance_request_details_maintenance_request_id on maintenance_request_details mrd (cost=0.43..0.54 rows=1 width=632) (actual time=0.002..0.002 rows=1 loops=1,474,333)

  • Index Cond: (maintenance_request_id = mr.id)
  • Filter: ((actual_start_datetime >= '2018-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 = 235))
  • Rows Removed by Filter: 0
39. 0.000 0.000 ↓ 0.0 0 1,474,198

Index Scan using pk_customers on customers c (cost=0.42..0.45 rows=1 width=81) (actual time=0.000..0.000 rows=0 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.customer_id))
40. 0.656 2.165 ↑ 1.1 4,589 1

Hash (cost=297.43..297.43 rows=5,100 width=19) (actual time=2.165..2.165 rows=4,589 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 266kB
41. 1.509 1.509 ↑ 1.1 4,589 1

Seq Scan on customer_phone_numbers cpn (cost=0.00..297.43 rows=5,100 width=19) (actual time=0.066..1.509 rows=4,589 loops=1)

  • Filter: ((phone_number_type_id <> 1) AND (cid = 235))
  • Rows Removed by Filter: 6773
42. 1,474.198 1,474.198 ↑ 1.0 1 1,474,198

Index Scan using pk_maintenance_problems on maintenance_problems mp (cost=0.29..0.31 rows=1 width=673) (actual time=0.001..0.001 rows=1 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.maintenance_problem_id))
43. 0.018 0.337 ↑ 1.0 79 1

Hash (cost=72.00..72.00 rows=79 width=683) (actual time=0.337..0.337 rows=79 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
44. 0.319 0.319 ↑ 1.0 79 1

Seq Scan on maintenance_statuses mst (cost=0.00..72.00 rows=79 width=683) (actual time=0.034..0.319 rows=79 loops=1)

  • Filter: (cid = 235)
  • Rows Removed by Filter: 561
45. 0.731 10.424 ↑ 1.0 2,910 1

Hash (cost=1,413.66..1,413.66 rows=2,928 width=42) (actual time=10.424..10.424 rows=2,910 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 236kB
46. 1.066 9.693 ↑ 1.0 2,910 1

Merge Left Join (cost=13.36..1,413.66 rows=2,928 width=42) (actual time=0.603..9.693 rows=2,910 loops=1)

  • Merge Cond: (ce.id = cu.company_employee_id)
  • Join Filter: (cu.cid = ce.cid)
47. 2.547 2.547 ↑ 1.0 2,908 1

Index Scan using idx_company_employees_id on company_employees ce (cost=0.29..798.18 rows=2,928 width=21) (actual time=0.014..2.547 rows=2,908 loops=1)

  • Filter: (cid = 235)
  • Rows Removed by Filter: 5689
48. 6.080 6.080 ↑ 4.3 2,090 1

Index Scan using idx_company_users_cid_company_employee_id on company_users cu (cost=0.42..37,560.35 rows=8,914 width=29) (actual time=0.053..6.080 rows=2,090 loops=1)

  • Filter: ((cid = 235) AND (company_user_type_id = 2))
  • Rows Removed by Filter: 6771
49. 0.000 0.000 ↓ 0.0 0 1,474,198

Index Scan using pk_maintenance_problems on maintenance_problems mp2 (cost=0.29..0.82 rows=1 width=665) (actual time=0.000..0.000 rows=0 loops=1,474,198)

  • Index Cond: ((cid = 235) AND (id = mp.maintenance_problem_id))
50. 1,474.198 1,474.198 ↑ 1.0 1 1,474,198

Index Scan using pk_maintenance_locations on maintenance_locations ml (cost=0.28..0.30 rows=1 width=915) (actual time=0.001..0.001 rows=1 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.maintenance_location_id))
51. 1,474.198 1,474.198 ↑ 1.0 1 1,474,198

Index Scan using pk_maintenance_priorities on maintenance_priorities mpr (cost=0.28..0.30 rows=1 width=632) (actual time=0.001..0.001 rows=1 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.maintenance_priority_id))
52. 0.011 0.029 ↑ 1.0 57 1

Hash (cost=1.71..1.71 rows=57 width=40) (actual time=0.029..0.029 rows=57 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
53. 0.018 0.018 ↑ 1.0 57 1

Seq Scan on work_order_materials_cost (cost=0.00..1.71 rows=57 width=40) (actual time=0.010..0.018 rows=57 loops=1)

  • Filter: (cid = 235)
54. 0.039 0.083 ↑ 1.0 265 1

Hash (cost=5.31..5.31 rows=265 width=40) (actual time=0.083..0.083 rows=265 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
55. 0.044 0.044 ↑ 1.0 265 1

Seq Scan on work_order_labors_cost (cost=0.00..5.31 rows=265 width=40) (actual time=0.010..0.044 rows=265 loops=1)

  • Filter: (cid = 235)
56. 1,474.198 1,474.198 ↑ 1.0 1 1,474,198

Index Scan using pk_properties on properties p (cost=0.28..0.31 rows=1 width=29) (actual time=0.001..0.001 rows=1 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.property_id))
57. 2,948.396 2,948.396 ↑ 1.0 1 1,474,198

Index Scan using pk_property_units on property_units pu (cost=0.29..0.32 rows=1 width=211) (actual time=0.002..0.002 rows=1 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.property_unit_id))
58. 1,474.198 1,474.198 ↑ 1.0 1 1,474,198

Index Scan using pk_property_buildings on property_buildings pb (cost=0.28..0.32 rows=1 width=169) (actual time=0.001..0.001 rows=1 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = COALESCE(mr.property_building_id, pu.property_building_id)))
59. 0.000 0.000 ↓ 0.0 0 1,474,198

Index Scan using pk_unit_spaces on unit_spaces us (cost=0.42..0.45 rows=1 width=22) (actual time=0.000..0.000 rows=0 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) 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))
60. 0.004 0.019 ↑ 1.0 7 1

Hash (cost=2.07..2.07 rows=7 width=122) (actual time=0.018..0.019 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
61. 0.015 0.015 ↑ 1.0 7 1

Seq Scan on unit_space_status_types usst (cost=0.00..2.07 rows=7 width=122) (actual time=0.009..0.015 rows=7 loops=1)

62. 0.000 0.000 ↓ 0.0 0 1,474,198

Index Scan using pk_unit_types on unit_types ut (cost=0.28..0.33 rows=1 width=161) (actual time=0.000..0.000 rows=0 loops=1,474,198)

  • Index Cond: ((cid = us.cid) AND (cid = 235) AND (id = COALESCE(pu.unit_type_id, us.unit_type_id)))
63. 1,474.198 1,474.198 ↓ 0.0 0 1,474,198

Index Scan using unq_idx_maintenance_request_notes_is_closing_note on maintenance_request_notes (cost=0.28..0.30 rows=1 width=160) (actual time=0.001..0.001 rows=0 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = mr.cid) AND (cid = 235) AND (maintenance_request_id = mr.id) AND (maintenance_request_id = mr.id))
64. 0.000 2,948.396 ↓ 0.0 0 1,474,198

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

  • Filter: ((mrn_internal.cid = 235) AND (mrn_internal.cid = mr.cid) AND (mrn_internal.maintenance_request_id = mr.id))
65. 0.000 2,948.396 ↓ 0.0 0 1,474,198

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

66. 1,474.198 2,948.396 ↓ 0.0 0 1,474,198

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

  • Sort Key: maintenance_request_notes_1.id DESC
  • Sort Method: quicksort Memory: 25kB
67. 1,474.198 1,474.198 ↓ 0.0 0 1,474,198

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=1,474,198)

  • 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
68. 0.000 0.000 ↓ 0.0 0 1,474,198

Index Scan using pk_ap_payees on ap_payees ap (cost=0.29..0.31 rows=1 width=22) (actual time=0.000..0.000 rows=0 loops=1,474,198)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.ap_payee_id))
69. 1,474.198 4,422.594 ↓ 0.0 0 1,474,198

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

70. 1,474.198 2,948.396 ↓ 0.0 0 1,474,198

Sort (cost=21.24..21.24 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=1,474,198)

  • Sort Key: maintenance_request_labors.id
  • Sort Method: top-N heapsort Memory: 25kB
71. 0.000 1,474.198 ↓ 0.0 0 1,474,198

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=1,474,198)

  • Recheck Cond: (mr.id = maintenance_request_id)
  • Filter: (mr.cid = cid)
  • Heap Blocks: exact=153
72. 1,474.198 1,474.198 ↓ 0.0 0 1,474,198

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=1,474,198)

  • Index Cond: (maintenance_request_id = mr.id)
73. 2,948.396 2,948.396 ↑ 1.0 1 1,474,198

Index Scan using uk_property_maintenance_priorities_property_id_maintenance_prio on property_maintenance_priorities pmp (cost=0.42..0.45 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=1,474,198)

  • 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 = 235))
74. 0.022 254.098 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=4) (actual time=254.097..254.098 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
75. 254.076 254.076 ↑ 1.0 4 1

Seq Scan on maintenance_status_types msts (cost=0.00..1.04 rows=4 width=4) (actual time=254.071..254.076 rows=4 loops=1)

76. 0.022 0.379 ↑ 1.8 102 1

Hash (cost=665.74..665.74 rows=182 width=16) (actual time=0.379..0.379 rows=102 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
77. 0.325 0.357 ↑ 1.8 102 1

Bitmap Heap Scan on property_preferences pp (cost=9.84..665.74 rows=182 width=16) (actual time=0.056..0.357 rows=102 loops=1)

  • Recheck Cond: ((key)::text = 'ENABLE_RESPONSE_TIME'::text)
  • Heap Blocks: exact=56
78. 0.032 0.032 ↑ 1.8 102 1

Bitmap Index Scan on idx_property_preferences_key (cost=0.00..9.79 rows=182 width=0) (actual time=0.032..0.032 rows=102 loops=1)

  • Index Cond: ((key)::text = 'ENABLE_RESPONSE_TIME'::text)
79. 0.000 2,948.396 ↓ 0.0 0 1,474,198

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

80. 1,474.198 2,948.396 ↓ 0.0 0 1,474,198

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

  • Sort Key: et1.event_datetime DESC
  • Sort Method: quicksort Memory: 25kB
81. 0.000 1,474.198 ↓ 0.0 0 1,474,198

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

  • Filter: (((et2.scheduled_end_datetime)::date >= '2019-12-31'::date) OR (et2.scheduled_end_datetime IS NULL))
82. 1,474.198 1,474.198 ↓ 0.0 0 1,474,198

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=1,474,198)

  • Index Cond: (property_unit_id = pu.id)
  • Filter: ((notes IS NOT NULL) AND (cid = 235) AND (event_type_id = 436) AND ((scheduled_datetime)::date < '2020-01-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 0
83. 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 = 235) 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))