explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Noaw

Settings
# exclusive inclusive rows x rows loops node
1. 1.984 8,091.590 ↓ 806.0 806 1

Sort (cost=459.00..459.01 rows=1 width=403) (actual time=8,091.393..8,091.590 rows=806 loops=1)

  • Sort Key: mr.id
  • Sort Method: quicksort Memory: 287kB
2. 20.639 8,089.606 ↓ 806.0 806 1

Nested Loop Left Join (cost=27.87..458.99 rows=1 width=403) (actual time=589.139..8,089.606 rows=806 loops=1)

3. 0.985 8,066.549 ↓ 806.0 806 1

Nested Loop Left Join (cost=27.59..458.20 rows=1 width=236) (actual time=588.546..8,066.549 rows=806 loops=1)

4. 1.241 8,062.340 ↓ 806.0 806 1

Nested Loop Left Join (cost=27.16..457.31 rows=1 width=236) (actual time=588.542..8,062.340 rows=806 loops=1)

5. 2.145 8,061.099 ↓ 806.0 806 1

Nested Loop Left Join (cost=26.89..457.01 rows=1 width=234) (actual time=588.537..8,061.099 rows=806 loops=1)

  • Filter: ((ml.id = ANY ('{41139,38564,38565,40932,40933,38527,40867,40884,41580,41581,41579,40974,40975,40976,40977,40978,40979,40980,40981,40982,42242,39206,40803,38805,40043,40802,38526,40796,40797,40798,41961,40953,41664,41665,38436,38457,38646,38645,36688,36604,36635,36891,36532,37710,37712,38223,38471,36382,38472,36889,39735,39736,37711,36531,36518,38606,38607,37709,36577,38597,41052,38374,36507,36533,36637,36636,37934,37944,39957,32794,37368,38515,1486,39212,37945,37946,40636,40637,32791,39956,11507,40632,40633,40634,40635,32790,37370,40934,18332,36638,38334,39211,39210,40935,37655,37369,38284,33657,38282,38283,38543,36626,38333,40579,39006,38609,17143,17144,32792,38285,40687,37947,39213,1315,38286,38288,41518,41519,36566,38287,32795,38335,38473,38525,37366,38775,38919,39214,37948,40686,36077,39207,36567,37949,32793,37371,39208,40885,37524,38022,36516,40835,40864,40865,40866,38644,40972,37367,289,802,36686,38927,36383,38005,32374,35821,32258,38260,38261,42084,40639,40936,17683,460,973,1828,40954,5360,40638,41025,41049,41088,41092,18333,40955,39176,42361,41217,33120,41094,41095,40942,40949,42362,41475,41140,41050,40946,40952,40945,40940,41004,40943,41138,38777,38788,40642,39177,39955,38197,1657,39215,118,40080,36363,42364,36208,39583,36605,36327,38262,36326,35523,34608,36517,35690,36494,39860,37707,37708,39527,39528,34609,36207,38060,40715,37943,38061,38506,37926,36534,36888,37561,37562,35407,36606,37522,42223,40596,40950,37523,40750,40597,36086,36087,40079,41026,41048,40948,41051,40941,40947,41005,42363,39209,19197,41086,41087,41137,631,17682,36535,1144,40066}'::integer[])) OR (mr.maintenance_location_id IS NULL))
6. 0.726 8,056.536 ↓ 806.0 806 1

Nested Loop Left Join (cost=26.60..456.36 rows=1 width=220) (actual time=588.509..8,056.536 rows=806 loops=1)

7. 0.779 8,054.198 ↓ 806.0 806 1

Nested Loop (cost=26.31..453.15 rows=1 width=217) (actual time=588.488..8,054.198 rows=806 loops=1)

8. 0.850 8,049.943 ↓ 869.0 869 1

Nested Loop (cost=26.02..452.69 rows=1 width=202) (actual time=588.458..8,049.943 rows=869 loops=1)

9. 0.988 8,046.486 ↓ 869.0 869 1

Nested Loop (cost=25.74..452.39 rows=1 width=197) (actual time=588.434..8,046.486 rows=869 loops=1)

10. 0.849 8,043.760 ↓ 869.0 869 1

Nested Loop (cost=25.61..452.14 rows=1 width=193) (actual time=588.424..8,043.760 rows=869 loops=1)

  • Join Filter: (mrl.maintenance_request_id = mrd.maintenance_request_id)
11. 2.762 8,035.959 ↓ 869.0 869 1

Nested Loop (cost=25.18..448.56 rows=1 width=150) (actual time=588.376..8,035.959 rows=869 loops=1)

12. 252.385 8,030.590 ↓ 869.0 869 1

Nested Loop (cost=25.05..447.98 rows=1 width=154) (actual time=588.141..8,030.590 rows=869 loops=1)

  • Join Filter: (p.id = mr.property_id)
  • Rows Removed by Join Filter: 806432
13. 176.500 3,741.700 ↓ 807,301.0 807,301 1

Nested Loop (cost=24.62..439.30 rows=1 width=126) (actual time=40.218..3,741.700 rows=807,301 loops=1)

14. 217.189 1,143.297 ↓ 36,695.5 807,301 1

Nested Loop (cost=24.20..268.76 rows=22 width=128) (actual time=40.175..1,143.297 rows=807,301 loops=1)

15. 1.710 47.274 ↓ 929.0 929 1

Nested Loop (cost=0.54..9.32 rows=1 width=33) (actual time=40.010..47.274 rows=929 loops=1)

16. 40.919 40.919 ↓ 929.0 929 1

Function Scan on load_properties lp (cost=0.25..1.00 rows=1 width=4) (actual time=39.993..40.919 rows=929 loops=1)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
  • Rows Removed by Filter: 248
17. 4.645 4.645 ↑ 1.0 1 929

Index Scan using idx_properties_id on properties p (cost=0.29..8.30 rows=1 width=29) (actual time=0.005..0.005 rows=1 loops=929)

  • Index Cond: (id = lp.property_id)
  • Filter: (cid = 235)
18. 825.881 878.834 ↓ 4.7 869 929

Bitmap Heap Scan on maintenance_request_labors mrl (cost=23.66..257.58 rows=186 width=95) (actual time=0.069..0.946 rows=869 loops=929)

  • Recheck Cond: (cid = 235)
  • Filter: (((deleted_on IS NULL) OR (deleted_on > '2018-12-31 00:00:00-07'::timestamp with time zone)) AND (company_employee_id = ANY ('{442508,325845,326178,455746,442510,514028,514461,442509,514454,325249,303879,513800,513102,319705,323753,484755,324211,306367,317322,306833,306005,177815,182256,514194,312515,178588,324735,324099,323018,419319,324274,324448,436558,513394,324828,102799,513159,388652,513937,379171,513099,513244,302792,411881,204752,204754,204755,204756,513160,173736,322845,173604,304706,323689,174519,382472,324135,175926,323936,306091,493884,493885,513383,317279,204773,312483,322217,326018,325098,312395,462610,323688,324166,324852,324853,181365,302996,324526,513351,192128,310213,305950,324378,323774,325409,481650,182338,204671,513047,419094,514035}'::integer[])))
  • Rows Removed by Filter: 109
  • Heap Blocks: exact=64101
19. 52.953 52.953 ↑ 1.0 978 929

Bitmap Index Scan on pk_maintenance_request_labors (cost=0.00..23.62 rows=978 width=0) (actual time=0.057..0.057 rows=978 loops=929)

  • Index Cond: (cid = 235)
20. 2,421.903 2,421.903 ↑ 1.0 1 807,301

Index Scan using idx_company_employees_id on company_employees ce (cost=0.42..7.75 rows=1 width=10) (actual time=0.003..0.003 rows=1 loops=807,301)

  • Index Cond: (id = mrl.company_employee_id)
  • Filter: (cid = 235)
21. 4,036.505 4,036.505 ↑ 1.0 1 807,301

Index Scan using pk_maintenance_requests on maintenance_requests mr (cost=0.43..8.66 rows=1 width=44) (actual time=0.004..0.005 rows=1 loops=807,301)

  • Index Cond: ((cid = 235) AND (id = mrl.maintenance_request_id))
  • Filter: ((parent_maintenance_request_id IS NULL) AND ((deleted_on IS NULL) OR (deleted_on > '2018-12-31 00:00:00-07'::timestamp with time zone)) AND (ps_product_id = ANY ('{7,1,21981,56,14,46,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}'::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,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,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[])))
22. 2.607 2.607 ↑ 1.0 1 869

Index Only Scan using pk_maintenance_request_types on maintenance_request_types mrt (cost=0.13..0.43 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=869)

  • Index Cond: ((id = mr.maintenance_request_type_id) AND (id = ANY ('{3,2,1}'::integer[])))
  • Heap Fetches: 869
23. 6.952 6.952 ↑ 1.0 1 869

Index Scan using idx_maintenance_request_details_maintenance_request_id on maintenance_request_details mrd (cost=0.43..3.57 rows=1 width=55) (actual time=0.007..0.008 rows=1 loops=869)

  • Index Cond: (maintenance_request_id = mr.id)
  • Filter: ((cid = 235) AND (date(actual_start_datetime) >= '2018-01-01'::date) AND (date(actual_start_datetime) <= '2018-12-31'::date))
24. 1.738 1.738 ↑ 1.0 1 869

Index Scan using pk_maintenance_request_labor_types on maintenance_request_labor_types mrlt (cost=0.13..0.21 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=869)

  • Index Cond: (id = mrl.maintenance_request_labor_type_id)
25. 2.607 2.607 ↑ 1.0 1 869

Index Scan using idx_maintenance_statuses_id on maintenance_statuses ms (cost=0.28..0.30 rows=1 width=17) (actual time=0.003..0.003 rows=1 loops=869)

  • Index Cond: (id = mr.maintenance_status_id)
  • Filter: (cid = 235)
  • Rows Removed by Filter: 0
26. 3.476 3.476 ↑ 1.0 1 869

Index Scan using pk_maintenance_problems on maintenance_problems mp (cost=0.29..0.45 rows=1 width=23) (actual time=0.004..0.004 rows=1 loops=869)

  • Index Cond: ((cid = 235) AND (id = mr.maintenance_problem_id))
  • Filter: ((maintenance_problem_id = ANY ('{485858,485857,483038,483041,483044,490673,490670,490666,412709,370154,486974,419303,329433,338418,421548,329409,421537,337796,329412,421535,375154,421543,102521,421512,329416,421550,421541,421526,329438,403438,421453,101701,337786,338419,421528,483883,421562,421533,421531,421517,329422,461879,421456,408871,477344,329145,124322,498386,421558,329427,421556,421554,329441,498385,498384,421560,329430,421539,101782,337791,400483,326584,375146,337859,472105,489507,421552,329425,421545,375323}'::integer[])) OR (maintenance_problem_id IS NULL))
27. 1.612 1.612 ↑ 1.0 1 806

Index Scan using pk_maintenance_problems on maintenance_problems map (cost=0.29..3.20 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=806)

  • Index Cond: ((cid = mp.cid) AND (cid = 235) AND (id = mp.maintenance_problem_id))
  • Filter: (maintenance_problem_type_id = 2)
28. 2.418 2.418 ↑ 1.0 1 806

Index Scan using pk_maintenance_locations on maintenance_locations ml (cost=0.28..0.31 rows=1 width=22) (actual time=0.003..0.003 rows=1 loops=806)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.maintenance_location_id))
29. 0.000 0.000 ↓ 0.0 0 806

Index Scan using pk_assets on assets a (cost=0.28..0.30 rows=1 width=14) (actual time=0.000..0.000 rows=0 loops=806)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.asset_id))
30. 3.224 3.224 ↑ 1.0 1 806

Index Scan using pk_property_units on property_units pu (cost=0.42..0.89 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=806)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.property_unit_id))
31. 2.418 2.418 ↑ 1.0 1 806

Index Scan using idx_property_buildings_id on property_buildings pb (cost=0.29..0.34 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=806)

  • Index Cond: (id = pu.property_building_id)
  • Filter: ((cid = 235) AND (cid = pu.cid))