explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HPMI : Initial

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,529.185 253,798.737 ↓ 57.8 57,780 1

Merge Left Join (cost=160,604.87..350,111.51 rows=1,000 width=91) (actual time=1,225.186..253,798.737 rows=57,780 loops=1)

  • Merge Cond: (us.id = st.unit_space_id)
  • Join Filter: ((st.cid = us.cid) AND (st.property_id = us.property_id) AND ((generate_series.generate_series)::date >= st.scheduled_start_date) AND ((generate_series.generate_series)::date <= st.scheduled_end_date))
2. 95,044.698 251,970.391 ↓ 57.8 57,780 1

Nested Loop Left Join (cost=11,384.80..200,818.91 rows=1,000 width=312) (actual time=926.077..251,970.391 rows=57,780 loops=1)

  • Join Filter: ((cl.cid = us.cid) AND (cl.property_id = us.property_id) AND (cl.unit_space_id = us.id) AND ((generate_series.generate_series)::date >= COALESCE(li.lease_start_date, (generate_series.generate_series)::date)) AND ((generate_series.generate_series)::date <= COALESCE(li.lease_end_date, (generate_series.generate_series)::date)))
  • Rows Removed by Join Filter: 858,200,313
3. 107.858 91,812.141 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,695.28..182,735.41 rows=1,000 width=260) (actual time=418.342..91,812.141 rows=57,776 loops=1)

  • Join Filter: (((generate_series.generate_series)::date >= COALESCE((mrd.scheduled_start_datetime)::date, (generate_series.generate_series)::date)) AND ((generate_series.generate_series)::date <= COALESCE((mrd.scheduled_end_datetime)::date, (generate_series.generate_series)::date)))
  • Rows Removed by Join Filter: 3,309
4. 75.462 91,357.627 ↓ 57.8 57,776 1

Merge Left Join (cost=1,694.28..159,903.90 rows=1,000 width=228) (actual time=418.312..91,357.627 rows=57,776 loops=1)

  • Merge Cond: (us.id = ocus_1.unit_space_id)
  • Join Filter: ((oc.cid = us.cid) AND ((generate_series.generate_series)::date >= lsw_1.start_date) AND ((generate_series.generate_series)::date <= lsw_1.end_date))
  • Rows Removed by Join Filter: 3,550
5. 125.044 91,138.257 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,635.54..158,592.94 rows=1,000 width=196) (actual time=370.819..91,138.257 rows=57,776 loops=1)

6. 65.686 81,017.965 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,614.86..137,882.44 rows=1,000 width=203) (actual time=370.611..81,017.965 rows=57,776 loops=1)

7. 95.240 16,127.607 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,532.70..55,693.10 rows=1,000 width=170) (actual time=369.386..16,127.607 rows=57,776 loops=1)

8. 132.781 5,286.031 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,503.64..26,598.59 rows=1,000 width=137) (actual time=369.022..5,286.031 rows=57,776 loops=1)

9. 147.932 588.946 ↓ 57.8 57,776 1

Merge Left Join (cost=1,478.56..1,488.59 rows=1,000 width=73) (actual time=368.858..588.946 rows=57,776 loops=1)

  • Merge Cond: ((us.id = laus.unit_space_id) AND (((generate_series.generate_series)::date) = laus.move_in_date))
  • Join Filter: (us.cid = laus.cid)
10. 115.262 137.733 ↓ 57.8 57,776 1

Sort (cost=1,477.68..1,480.18 rows=1,000 width=61) (actual time=108.008..137.733 rows=57,776 loops=1)

  • Sort Key: us.id, ((generate_series.generate_series)::date)
  • Sort Method: quicksort Memory: 9,661kB
11. 13.056 22.471 ↓ 57.8 57,776 1

Nested Loop (cost=468.80..1,427.85 rows=1,000 width=61) (actual time=1.433..22.471 rows=57,776 loops=1)

12. 0.130 6.275 ↓ 628.0 628 1

Nested Loop (cost=468.79..1,407.84 rows=1 width=53) (actual time=1.393..6.275 rows=628 loops=1)

13. 0.256 2.377 ↓ 16.5 628 1

Hash Join (cost=468.37..1,109.87 rows=38 width=49) (actual time=1.361..2.377 rows=628 loops=1)

  • Hash Cond: (us.property_floorplan_id = pf.id)
14. 0.823 0.823 ↓ 4.4 628 1

Index Scan using idx_unit_spaces_company_property_id on unit_spaces us (cost=0.42..641.54 rows=144 width=41) (actual time=0.021..0.823 rows=628 loops=1)

  • Index Cond: ((cid = 235) AND (property_id = ANY ('{550592}'::integer[])))
  • Filter: ((deleted_on IS NULL) AND (occupancy_type_id <> 2))
  • Rows Removed by Filter: 5
15. 0.368 1.298 ↓ 1.0 2,342 1

Hash (cost=438.69..438.69 rows=2,341 width=12) (actual time=1.298..1.298 rows=2,342 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 133kB
16. 0.810 0.930 ↓ 1.0 2,342 1

Bitmap Heap Scan on property_floorplans pf (cost=50.43..438.69 rows=2,341 width=12) (actual time=0.147..0.930 rows=2,342 loops=1)

  • Recheck Cond: (cid = 235)
  • Heap Blocks: exact=193
17. 0.120 0.120 ↓ 1.0 2,356 1

Bitmap Index Scan on pk_property_floorplans (cost=0.00..49.84 rows=2,341 width=0) (actual time=0.120..0.120 rows=2,356 loops=1)

  • Index Cond: (cid = 235)
18. 3.768 3.768 ↑ 1.0 1 628

Index Scan using pk_property_units on property_units pu (cost=0.42..7.83 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=628)

  • Index Cond: ((cid = 235) AND (id = us.property_unit_id))
  • Filter: (us.property_id = property_id)
19. 3.140 3.140 ↑ 10.9 92 628

Function Scan on generate_series (cost=0.01..10.01 rows=1,000 width=8) (actual time=0.000..0.005 rows=92 loops=628)

20. 70.424 303.281 ↓ 52,256.0 52,256 1

Sort (cost=0.89..0.89 rows=1 width=24) (actual time=260.837..303.281 rows=52,256 loops=1)

  • Sort Key: laus.unit_space_id, laus.move_in_date
  • Sort Method: quicksort Memory: 5,619kB
21. 232.857 232.857 ↓ 52,256.0 52,256 1

Function Scan on load_available_unit_spaces laus (cost=0.25..0.88 rows=1 width=24) (actual time=224.822..232.857 rows=52,256 loops=1)

  • Filter: (cid = 235)
22. 924.416 4,564.304 ↑ 1.0 1 57,776

Aggregate (cost=25.08..25.09 rows=1 width=64) (actual time=0.079..0.079 rows=1 loops=57,776)

23. 635.536 3,639.888 ↓ 2.4 12 57,776

Nested Loop Left Join (cost=0.85..25.05 rows=5 width=8) (actual time=0.032..0.063 rows=12 loops=57,776)

  • Join Filter: ((lt_1.lease_term_type_id = 2) AND (lt_1.cid = lsw_2.cid) AND (lsw_2.property_id = pcs.property_id) AND (lt_1.id = lsw_2.lease_term_id))
  • Rows Removed by Join Filter: 48
24. 231.104 1,386.624 ↓ 1.4 7 57,776

Nested Loop (cost=0.57..16.62 rows=5 width=16) (actual time=0.016..0.024 rows=7 loops=57,776)

25. 462.208 462.208 ↑ 1.0 1 57,776

Index Scan using idx_property_charge_settings_property_id on property_charge_settings pcs (cost=0.28..8.30 rows=1 width=12) (actual time=0.008..0.008 rows=1 loops=57,776)

  • Index Cond: (property_id = us.property_id)
  • Filter: (cid = us.cid)
26. 693.312 693.312 ↓ 7.0 7 57,776

Index Scan using idx_lease_terms_master on lease_terms lt_1 (cost=0.29..8.30 rows=1 width=16) (actual time=0.005..0.012 rows=7 loops=57,776)

  • Index Cond: ((cid = us.cid) AND (lease_term_structure_id = pcs.lease_term_structure_id))
  • Filter: (deleted_on IS NULL)
  • Rows Removed by Filter: 1
27. 231.104 1,617.728 ↓ 8.0 8 404,432

Materialize (cost=0.29..8.32 rows=1 width=16) (actual time=0.001..0.004 rows=8 loops=404,432)

28. 1,386.624 1,386.624 ↓ 8.0 8 57,776

Index Scan using idx_lease_start_windows_cid_property_id on lease_start_windows lsw_2 (cost=0.29..8.31 rows=1 width=16) (actual time=0.007..0.024 rows=8 loops=57,776)

  • Index Cond: ((cid = us.cid) AND (property_id = us.property_id))
  • Filter: ((deleted_on IS NULL) AND (is_active IS TRUE) AND (end_date >= (generate_series.generate_series)::date))
  • Rows Removed by Filter: 37
29. 57.776 10,746.336 ↑ 1.0 1 57,776

Aggregate (cost=29.06..29.07 rows=1 width=33) (actual time=0.186..0.186 rows=1 loops=57,776)

30. 223.652 10,688.560 ↓ 0.0 0 57,776

Nested Loop (cost=16.93..29.05 rows=1 width=4) (actual time=0.184..0.185 rows=0 loops=57,776)

31. 462.208 10,457.456 ↓ 0.0 0 57,776

Bitmap Heap Scan on rate_associations ra (cost=16.65..20.68 rows=1 width=8) (actual time=0.181..0.181 rows=0 loops=57,776)

  • Recheck Cond: ((ar_cascade_reference_id = us.id) AND (property_id = pf.property_id))
  • Filter: ((cid = pf.cid) AND (ar_origin_id = 2) AND (ar_cascade_id = 4))
  • Rows Removed by Filter: 7
  • Heap Blocks: exact=279,680
32. 115.552 9,995.248 ↓ 0.0 0 57,776

BitmapAnd (cost=16.65..16.65 rows=1 width=0) (actual time=0.173..0.173 rows=0 loops=57,776)

33. 288.880 288.880 ↑ 1.0 7 57,776

Bitmap Index Scan on idx_rate_associations_rate_cascade_reference_id (cost=0.00..4.47 rows=7 width=0) (actual time=0.005..0.005 rows=7 loops=57,776)

  • Index Cond: (ar_cascade_reference_id = us.id)
34. 9,590.816 9,590.816 ↓ 9.5 4,439 57,776

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..11.93 rows=468 width=0) (actual time=0.166..0.166 rows=4,439 loops=57,776)

  • Index Cond: (property_id = pf.property_id)
35. 7.452 7.452 ↑ 1.0 1 2,484

Index Only Scan using pk_amenities on amenities a (cost=0.28..8.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=2,484)

  • Index Cond: ((cid = pf.cid) AND (id = ra.ar_origin_reference_id))
  • Heap Fetches: 2,484
36. 462.208 64,824.672 ↑ 1.0 1 57,776

Aggregate (cost=82.16..82.17 rows=1 width=33) (actual time=1.121..1.122 rows=1 loops=57,776)

37. 866.640 64,362.464 ↓ 12.0 12 57,776

Nested Loop (cost=0.57..82.15 rows=1 width=4) (actual time=1.023..1.114 rows=12 loops=57,776)

38. 8,724.176 8,724.176 ↓ 474.0 474 57,776

Index Scan using idx_rate_associations_property_id_partial_origin6 on rate_associations ra_1 (cost=0.29..71.82 rows=1 width=8) (actual time=0.005..0.151 rows=474 loops=57,776)

  • Index Cond: (property_id = us.property_id)
  • Filter: (cid = us.cid)
39. 54,771.648 54,771.648 ↓ 0.0 0 27,385,824

Index Scan using pk_specials on specials s (cost=0.28..8.32 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=27,385,824)

  • Index Cond: ((cid = us.cid) AND (id = ra_1.ar_origin_reference_id))
  • Filter: ((NOT coupon_code_required) AND show_on_website AND is_active AND (deleted_on IS NULL) AND (special_type_id <> 5) AND (special_recipient_id = 2) AND ((generate_series.generate_series)::date >= COALESCE(start_date, (generate_series.generate_series)::date)) AND ((generate_series.generate_series)::date <= COALESCE(end_date, (generate_series.generate_series)::date)))
  • Rows Removed by Filter: 1
40. 173.328 9,995.248 ↑ 1.0 1 57,776

Aggregate (cost=20.68..20.69 rows=1 width=1) (actual time=0.173..0.173 rows=1 loops=57,776)

41. 346.656 9,821.920 ↓ 6.0 6 57,776

Bitmap Heap Scan on rate_associations ra_2 (cost=16.65..20.68 rows=1 width=0) (actual time=0.167..0.170 rows=6 loops=57,776)

  • Recheck Cond: ((ar_cascade_reference_id = us.id) AND (property_id = pf.property_id))
  • Filter: ((cid = pf.cid) AND (ar_origin_id = 3) AND (ar_cascade_id = 4))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=279,680
42. 115.552 9,475.264 ↓ 0.0 0 57,776

BitmapAnd (cost=16.65..16.65 rows=1 width=0) (actual time=0.164..0.164 rows=0 loops=57,776)

43. 173.328 173.328 ↑ 1.0 7 57,776

Bitmap Index Scan on idx_rate_associations_rate_cascade_reference_id (cost=0.00..4.47 rows=7 width=0) (actual time=0.003..0.003 rows=7 loops=57,776)

  • Index Cond: (ar_cascade_reference_id = us.id)
44. 9,186.384 9,186.384 ↓ 9.5 4,439 57,776

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..11.93 rows=468 width=0) (actual time=0.159..0.159 rows=4,439 loops=57,776)

  • Index Cond: (property_id = pf.property_id)
45. 2.116 143.908 ↓ 251.9 6,802 1

Materialize (cost=58.75..1,308.37 rows=27 width=48) (actual time=5.481..143.908 rows=6,802 loops=1)

46. 73.345 141.792 ↓ 107.0 2,889 1

Nested Loop (cost=58.75..1,308.30 rows=27 width=48) (actual time=5.477..141.792 rows=2,889 loops=1)

  • Join Filter: (oc.id = ocus_1.organization_contract_id)
  • Rows Removed by Join Filter: 1,095,486
47. 4.009 4.009 ↑ 1.1 2,929 1

Index Scan using idx_organization_contract_unit_spaces_unit_space_id on organization_contract_unit_spaces ocus_1 (cost=0.28..509.25 rows=3,101 width=12) (actual time=0.014..4.009 rows=2,929 loops=1)

  • Filter: ((deleted_on IS NULL) AND (cid = 235))
  • Rows Removed by Filter: 4,102
48. 56.504 64.438 ↓ 75.0 375 2,929

Materialize (cost=58.47..566.42 rows=5 width=48) (actual time=0.000..0.022 rows=375 loops=2,929)

49. 1.041 7.934 ↓ 75.0 375 1

Nested Loop (cost=58.47..566.39 rows=5 width=48) (actual time=0.492..7.934 rows=375 loops=1)

50. 0.327 2.018 ↓ 20.8 375 1

Nested Loop (cost=58.05..424.20 rows=18 width=32) (actual time=0.456..2.018 rows=375 loops=1)

51. 0.201 1.316 ↓ 15.6 375 1

Hash Join (cost=57.90..418.88 rows=24 width=24) (actual time=0.428..1.316 rows=375 loops=1)

  • Hash Cond: (lsw_1.id = oc.lease_start_window_id)
52. 0.724 0.842 ↑ 1.6 937 1

Bitmap Heap Scan on lease_start_windows lsw_1 (cost=32.78..388.00 rows=1,475 width=16) (actual time=0.139..0.842 rows=937 loops=1)

  • Recheck Cond: (cid = 235)
  • Filter: ((deleted_on IS NULL) AND (is_active IS TRUE))
  • Rows Removed by Filter: 674
  • Heap Blocks: exact=127
53. 0.118 0.118 ↓ 1.1 1,841 1

Bitmap Index Scan on pk_lease_start_windows (cost=0.00..32.41 rows=1,617 width=0) (actual time=0.118..0.118 rows=1,841 loops=1)

  • Index Cond: (cid = 235)
54. 0.058 0.273 ↓ 1.0 375 1

Hash (cost=20.49..20.49 rows=370 width=20) (actual time=0.273..0.273 rows=375 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
55. 0.215 0.215 ↓ 1.0 375 1

Seq Scan on organization_contracts oc (cost=0.00..20.49 rows=370 width=20) (actual time=0.019..0.215 rows=375 loops=1)

  • Filter: ((organization_contract_status_type_id = ANY ('{1,2}'::integer[])) AND (cid = 235))
  • Rows Removed by Filter: 203
56. 0.375 0.375 ↑ 1.0 1 375

Index Scan using pk_organizations on organizations o (cost=0.15..0.22 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=375)

  • Index Cond: ((cid = 235) AND (id = oc.organization_id))
57. 4.875 4.875 ↑ 1.0 1 375

Index Scan using pk_customers on customers c_1 (cost=0.42..7.90 rows=1 width=21) (actual time=0.013..0.013 rows=1 loops=375)

  • Index Cond: ((cid = 235) AND (id = o.customer_id))
58. 41.216 346.656 ↓ 0.0 0 57,776

Nested Loop (cost=0.99..22.80 rows=1 width=60) (actual time=0.006..0.006 rows=0 loops=57,776)

59. 98.440 288.880 ↓ 0.0 0 57,776

Nested Loop Left Join (cost=0.56..17.07 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=57,776)

  • Filter: ((COALESCE(ms.maintenance_status_type_id, 0) <> 3) AND (COALESCE(ms.maintenance_status_type_id, 0) <> 4))
  • Rows Removed by Filter: 0
60. 173.328 173.328 ↓ 0.0 0 57,776

Index Scan using idx_maintenance_requests_type_1 on maintenance_requests mr (cost=0.29..16.75 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=57,776)

  • Index Cond: (unit_space_id = us.id)
  • Filter: ((cid IS NOT NULL) AND (parent_maintenance_request_id IS NULL) AND (deleted_on IS NULL) AND (cid = 235) AND (cid = us.cid) AND (property_id = us.property_id))
  • Rows Removed by Filter: 0
61. 17.112 17.112 ↑ 1.0 1 5,704

Index Scan using pk_maintenance_statuses on maintenance_statuses ms (cost=0.28..0.31 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=5,704)

  • Index Cond: ((cid = mr.cid) AND (cid = 235) AND (id = mr.maintenance_status_id))
62. 16.560 16.560 ↑ 1.0 1 3,312

Index Scan using idx_maintenance_request_details_maintenance_request_id on maintenance_request_details mrd (cost=0.43..5.72 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=3,312)

  • Index Cond: (maintenance_request_id = mr.id)
63. 64,625.234 65,113.552 ↓ 2,970.8 14,854 57,776

Materialize (cost=9,689.52..17,908.51 rows=5 width=72) (actual time=0.001..1.127 rows=14,854 loops=57,776)

64. 104.886 488.318 ↓ 2,970.8 14,854 1

Nested Loop Left Join (cost=9,689.52..17,908.49 rows=5 width=72) (actual time=46.752..488.318 rows=14,854 loops=1)

  • Join Filter: (ocus.organization_contract_id = lsw.organization_contract_id)
  • Rows Removed by Join Filter: 832
65. 12.700 368.601 ↓ 2,966.2 14,831 1

Nested Loop Left Join (cost=9,689.24..17,906.81 rows=5 width=100) (actual time=46.704..368.601 rows=14,831 loops=1)

  • Join Filter: ((lt.cid = lsw.cid) AND (lt.id = lsw.lease_term_id) AND (lsw.property_id = cl.property_id))
  • Rows Removed by Join Filter: 10
66. 16.635 355.901 ↓ 2,966.2 14,831 1

Nested Loop (cost=9,688.95..17,905.12 rows=5 width=96) (actual time=46.699..355.901 rows=14,831 loops=1)

67. 13.610 324.435 ↓ 14,831.0 14,831 1

Nested Loop Left Join (cost=9,688.67..17,904.79 rows=1 width=88) (actual time=46.684..324.435 rows=14,831 loops=1)

68. 5.467 251.501 ↓ 14,831.0 14,831 1

Nested Loop Left Join (cost=9,688.25..17,902.65 rows=1 width=86) (actual time=46.646..251.501 rows=14,831 loops=1)

69. 16.708 201.544 ↓ 14,830.0 14,830 1

Nested Loop (cost=9,687.83..17,901.91 rows=1 width=82) (actual time=46.630..201.544 rows=14,830 loops=1)

  • Join Filter: ((cl.id = ca.lease_id) AND (cl.active_lease_interval_id = ca.lease_interval_id) AND (cl.unit_space_id = ca.unit_space_id))
  • Rows Removed by Join Filter: 3,944
70. 39.919 120.918 ↓ 21,306.0 21,306 1

Hash Join (cost=9,687.41..17,900.38 rows=1 width=82) (actual time=46.450..120.918 rows=21,306 loops=1)

  • Hash Cond: ((li.lease_id = cl.id) AND (li.id = cl.active_lease_interval_id))
71. 35.133 47.644 ↓ 1.0 136,663 1

Bitmap Heap Scan on lease_intervals li (cost=2,582.78..10,078.80 rows=136,562 width=28) (actual time=13.026..47.644 rows=136,663 loops=1)

  • Recheck Cond: (cid = 235)
  • Heap Blocks: exact=3,568
72. 12.511 12.511 ↓ 1.0 136,723 1

Bitmap Index Scan on pk_lease_intervals (cost=0.00..2,548.64 rows=136,562 width=0) (actual time=12.511..12.511 rows=136,723 loops=1)

  • Index Cond: (cid = 235)
73. 6.650 33.355 ↑ 1.2 21,306 1

Hash (cost=6,716.95..6,716.95 rows=25,845 width=54) (actual time=33.355..33.355 rows=21,306 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 2,087kB
74. 22.380 26.705 ↑ 1.2 21,306 1

Bitmap Heap Scan on cached_leases cl (cost=974.90..6,716.95 rows=25,845 width=54) (actual time=4.815..26.705 rows=21,306 loops=1)

  • Recheck Cond: (cid = 235)
  • Filter: (lease_status_type_id = ANY ('{3,4,5}'::integer[]))
  • Rows Removed by Filter: 29,777
  • Heap Blocks: exact=3,666
75. 4.325 4.325 ↑ 1.0 51,110 1

Bitmap Index Scan on pk_cached_leases (cost=0.00..968.44 rows=51,203 width=0) (actual time=4.325..4.325 rows=51,110 loops=1)

  • Index Cond: (cid = 235)
76. 63.918 63.918 ↑ 1.0 1 21,306

Index Scan using idx_cached_applications_lease_interval_id on cached_applications ca (cost=0.42..1.52 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=21,306)

  • Index Cond: (lease_interval_id = li.id)
  • Filter: ((cid = 235) AND (li.lease_id = lease_id))
77. 44.490 44.490 ↑ 1.0 1 14,830

Index Scan using idx_lease_unit_spaces_lease_id on lease_unit_spaces lus (cost=0.42..0.73 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=14,830)

  • Index Cond: (lease_id = cl.id)
  • Filter: ((cid = 235) AND (cl.cid = cid) AND (unit_space_id = cl.unit_space_id))
  • Rows Removed by Filter: 0
78. 59.324 59.324 ↑ 1.0 1 14,831

Index Scan using idx_customers_id on customers c (cost=0.42..2.13 rows=1 width=10) (actual time=0.004..0.004 rows=1 loops=14,831)

  • Index Cond: (id = cl.primary_customer_id)
  • Filter: ((cid = 235) AND (cl.cid = cid))
79. 14.831 14.831 ↑ 1.0 1 14,831

Index Scan using pk_lease_terms on lease_terms lt (cost=0.29..0.33 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=14,831)

  • Index Cond: ((cid = 235) AND (id = li.lease_term_id))
80. 0.000 0.000 ↓ 0.0 0 14,831

Index Scan using pk_lease_start_windows on lease_start_windows lsw (cost=0.29..0.32 rows=1 width=28) (actual time=0.000..0.000 rows=0 loops=14,831)

  • Index Cond: ((cid = 235) AND (id = li.lease_start_window_id))
  • Filter: ((deleted_on IS NULL) AND (is_active IS TRUE))
  • Rows Removed by Filter: 0
81. 14.831 14.831 ↓ 0.0 0 14,831

Index Scan using idx_organization_contract_unit_spaces_unit_space_id on organization_contract_unit_spaces ocus (cost=0.28..0.32 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=14,831)

  • Index Cond: (unit_space_id = cl.unit_space_id)
  • Filter: ((cid = 235) AND (cid = cl.cid))
82. 0.100 299.161 ↓ 93.0 93 1

Sort (cost=149,220.07..149,220.07 rows=1 width=52) (actual time=299.073..299.161 rows=93 loops=1)

  • Sort Key: st.unit_space_id
  • Sort Method: quicksort Memory: 25kB
83. 0.016 299.061 ↓ 2.0 2 1

Subquery Scan on st (cost=149,219.98..149,220.06 rows=1 width=52) (actual time=299.050..299.061 rows=2 loops=1)

  • Filter: ((st.scheduled_start_date <= '2020-12-16'::date) AND (st.scheduled_end_date >= '2020-09-16'::date))
  • Rows Removed by Filter: 4
84. 0.044 299.045 ↓ 6.0 6 1

WindowAgg (cost=149,219.98..149,220.04 rows=1 width=64) (actual time=299.033..299.045 rows=6 loops=1)

85. 0.066 299.001 ↓ 6.0 6 1

Sort (cost=149,219.98..149,219.99 rows=1 width=631) (actual time=299.000..299.001 rows=6 loops=1)

  • Sort Key: st_1.property_id, ((st_1.details ->> 'unit_space_id'::text)), st_1.start_on
  • Sort Method: quicksort Memory: 25kB
86. 257.823 298.935 ↓ 6.0 6 1

Bitmap Heap Scan on scheduled_tasks st_1 (cost=6,784.07..149,219.97 rows=1 width=631) (actual time=69.709..298.935 rows=6 loops=1)

  • Recheck Cond: (cid = 235)
  • Filter: ((deleted_by IS NULL) AND (deleted_on IS NULL) AND (property_id = ANY ('{550592}'::integer[])) AND (scheduled_task_type_id = 11))
  • Rows Removed by Filter: 365,128
  • Heap Blocks: exact=88,184
87. 41.112 41.112 ↑ 1.0 365,171 1

Bitmap Index Scan on pk_scheduled_tasks (cost=0.00..6,784.07 rows=366,886 width=0) (actual time=41.112..41.112 rows=365,171 loops=1)

  • Index Cond: (cid = 235)