explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8e37 : 7th

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1,139.767 145,481.068 ↓ 57.8 57,780 1

Merge Left Join (cost=361,127.81..715,287.14 rows=1,000 width=91) (actual time=2,965.818..145,481.068 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. 58.706 143,851.616 ↓ 57.8 57,780 1

Nested Loop Left Join (cost=211,839.92..565,926.72 rows=1,000 width=312) (actual time=2,476.151..143,851.616 rows=57,780 loops=1)

  • Join Filter: (((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: 8,213
3. 41.606 142,695.166 ↓ 57.8 57,776 1

Merge Left Join (cost=211,836.96..545,021.35 rows=1,000 width=260) (actual time=2,475.838..142,695.166 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
4. 63.051 142,642.132 ↓ 57.8 57,776 1

Merge Left Join (cost=211,089.27..544,271.00 rows=1,000 width=228) (actual time=2,466.022..142,642.132 rows=57,776 loops=1)

  • Merge Cond: (us.id = mr.unit_space_id)
  • Join Filter: ((mr.cid = us.cid) AND (mr.property_id = us.property_id) AND ((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
5. 58.044 140,552.213 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,823.84..334,986.97 rows=1,000 width=196) (actual time=440.366..140,552.213 rows=57,776 loops=1)

6. 63.974 130,614.473 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,803.20..314,313.97 rows=1,000 width=203) (actual time=440.191..130,614.473 rows=57,776 loops=1)

7. 81.759 120,150.819 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,774.18..285,256.96 rows=1,000 width=170) (actual time=439.929..120,150.819 rows=57,776 loops=1)

8. 98.483 9,196.916 ↓ 57.8 57,776 1

Nested Loop Left Join (cost=1,522.48..33,528.55 rows=1,000 width=137) (actual time=435.366..9,196.916 rows=57,776 loops=1)

9. 113.599 605.361 ↓ 57.8 57,776 1

Merge Left Join (cost=1,490.49..1,500.55 rows=1,000 width=73) (actual time=434.919..605.361 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. 107.288 130.145 ↓ 57.8 57,776 1

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

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

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

12. 0.365 5.977 ↓ 628.0 628 1

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

13. 0.256 3.728 ↓ 16.5 628 1

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

  • Hash Cond: (us.property_floorplan_id = pf.id)
14. 1.279 1.279 ↓ 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.074..1.279 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.391 2.193 ↓ 1.0 2,343 1

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 133kB
16. 1.637 1.802 ↓ 1.0 2,343 1

Bitmap Heap Scan on property_floorplans pf (cost=50.43..438.69 rows=2,341 width=12) (actual time=0.201..1.802 rows=2,343 loops=1)

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

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

  • Index Cond: (cid = 235)
18. 1.884 1.884 ↑ 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.003..0.003 rows=1 loops=628)

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

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

20. 63.313 361.617 ↓ 10,451.2 52,256 1

Sort (cost=12.81..12.82 rows=5 width=24) (actual time=327.245..361.617 rows=52,256 loops=1)

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

Function Scan on load_available_unit_spaces laus (cost=0.25..12.75 rows=5 width=24) (actual time=290.125..298.304 rows=52,256 loops=1)

  • Filter: (cid = 235)
22. 808.864 8,493.072 ↑ 1.0 1 57,776

Aggregate (cost=31.99..32.01 rows=1 width=64) (actual time=0.147..0.147 rows=1 loops=57,776)

23. 288.880 7,684.208 ↓ 2.4 12 57,776

Nested Loop Left Join (cost=11.78..31.96 rows=5 width=8) (actual time=0.105..0.133 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. 115.552 924.416 ↓ 1.4 7 57,776

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

25. 231.104 231.104 ↑ 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.003..0.004 rows=1 loops=57,776)

  • Index Cond: (property_id = us.property_id)
  • Filter: (cid = us.cid)
26. 577.760 577.760 ↓ 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.004..0.010 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. 635.536 6,470.912 ↓ 8.0 8 404,432

Materialize (cost=11.21..15.24 rows=1 width=16) (actual time=0.013..0.016 rows=8 loops=404,432)

28. 1,039.968 5,835.376 ↓ 8.0 8 57,776

Bitmap Heap Scan on lease_start_windows lsw_2 (cost=11.21..15.23 rows=1 width=16) (actual time=0.086..0.101 rows=8 loops=57,776)

  • Recheck Cond: ((property_id = us.property_id) AND (cid = us.cid))
  • Filter: ((deleted_on IS NULL) AND (is_active IS TRUE) AND (end_date >= (generate_series.generate_series)::date))
  • Rows Removed by Filter: 37
  • Heap Blocks: exact=173,328
29. 115.552 4,795.408 ↓ 0.0 0 57,776

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

30. 288.880 288.880 ↓ 5.6 45 57,776

Bitmap Index Scan on idx_lease_start_windows_property_id (cost=0.00..4.35 rows=8 width=0) (actual time=0.005..0.005 rows=45 loops=57,776)

  • Index Cond: (property_id = us.property_id)
31. 4,390.976 4,390.976 ↓ 5.9 1,842 57,776

Bitmap Index Scan on pk_lease_start_windows (cost=0.00..6.61 rows=310 width=0) (actual time=0.076..0.076 rows=1,842 loops=57,776)

  • Index Cond: (cid = us.cid)
32. 462.208 110,872.144 ↑ 1.0 1 57,776

Aggregate (cost=251.70..251.71 rows=1 width=33) (actual time=1.919..1.919 rows=1 loops=57,776)

33. 288.880 110,409.936 ↓ 12.0 12 57,776

Nested Loop (cost=173.10..251.69 rows=1 width=864) (actual time=1.803..1.911 rows=12 loops=57,776)

34. 24,901.456 55,349.408 ↓ 474.0 474 57,776

Bitmap Heap Scan on rate_associations ra (cost=172.82..241.36 rows=1 width=868) (actual time=0.538..0.958 rows=474 loops=57,776)

  • Recheck Cond: ((property_id = us.property_id) AND (ar_origin_id = 6))
  • Filter: (cid = us.cid)
  • Heap Blocks: exact=3,755,440
35. 866.640 30,447.952 ↓ 0.0 0 57,776

BitmapAnd (cost=172.82..172.82 rows=18 width=0) (actual time=0.527..0.527 rows=0 loops=57,776)

36. 9,301.936 9,301.936 ↓ 9.6 4,439 57,776

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..11.89 rows=463 width=0) (actual time=0.161..0.161 rows=4,439 loops=57,776)

  • Index Cond: (property_id = us.property_id)
37. 20,279.376 20,279.376 ↑ 1.0 8,382 57,776

Bitmap Index Scan on idx_rate_associations_ar_origin_id (cost=0.00..160.67 rows=8,567 width=0) (actual time=0.351..0.351 rows=8,382 loops=57,776)

  • Index Cond: (ar_origin_id = 6)
38. 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.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
39. 115.552 10,399.680 ↑ 1.0 1 57,776

Aggregate (cost=29.02..29.04 rows=1 width=33) (actual time=0.180..0.180 rows=1 loops=57,776)

40. 108.100 10,284.128 ↓ 0.0 0 57,776

Nested Loop (cost=16.90..29.02 rows=1 width=4) (actual time=0.178..0.178 rows=0 loops=57,776)

41. 404.432 10,168.576 ↓ 0.0 0 57,776

Bitmap Heap Scan on rate_associations ra_1 (cost=16.62..20.64 rows=1 width=8) (actual time=0.176..0.176 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
42. 115.552 9,764.144 ↓ 0.0 0 57,776

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

43. 231.104 231.104 ↑ 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.004..0.004 rows=7 loops=57,776)

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

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..11.89 rows=463 width=0) (actual time=0.163..0.163 rows=4,439 loops=57,776)

  • Index Cond: (property_id = pf.property_id)
45. 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_1.ar_origin_reference_id))
  • Heap Fetches: 2,484
46. 173.328 9,879.696 ↑ 1.0 1 57,776

Aggregate (cost=20.64..20.65 rows=1 width=1) (actual time=0.171..0.171 rows=1 loops=57,776)

47. 288.880 9,706.368 ↓ 6.0 6 57,776

Bitmap Heap Scan on rate_associations ra_2 (cost=16.62..20.64 rows=1 width=0) (actual time=0.166..0.168 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
48. 57.776 9,417.488 ↓ 0.0 0 57,776

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

49. 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)
50. 9,186.384 9,186.384 ↓ 9.6 4,439 57,776

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

  • Index Cond: (property_id = pf.property_id)
51. 2.193 2,026.868 ↑ 3.3 4,445 1

Sort (cost=209,265.43..209,302.50 rows=14,830 width=60) (actual time=2,025.498..2,026.868 rows=4,445 loops=1)

  • Sort Key: mr.unit_space_id
  • Sort Method: quicksort Memory: 360kB
52. 1.057 2,024.675 ↑ 12.7 1,171 1

Hash Left Join (cost=116,881.58..208,237.99 rows=14,830 width=60) (actual time=757.324..2,024.675 rows=1,171 loops=1)

  • Hash Cond: ((mr.cid = ms.cid) AND (mr.maintenance_status_id = ms.id))
  • Filter: ((COALESCE(ms.maintenance_status_type_id, 0) <> 3) AND (COALESCE(ms.maintenance_status_type_id, 0) <> 4))
  • Rows Removed by Filter: 734
53. 472.674 2,023.212 ↑ 7.9 1,905 1

Hash Join (cost=116,804.05..208,081.44 rows=14,979 width=64) (actual time=756.904..2,023.212 rows=1,905 loops=1)

  • Hash Cond: (mrd.maintenance_request_id = mr.id)
54. 793.796 793.796 ↓ 1.6 4,128,419 1

Seq Scan on maintenance_request_details mrd (cost=0.00..84,514.89 rows=2,533,389 width=20) (actual time=0.016..793.796 rows=4,128,419 loops=1)

55. 0.614 756.742 ↑ 12.8 1,905 1

Hash (cost=116,498.93..116,498.93 rows=24,410 width=20) (actual time=756.742..756.742 rows=1,905 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 353kB
56. 756.128 756.128 ↑ 12.8 1,905 1

Index Scan using idx_maintenance_request_parent_maintenance_request_id on maintenance_requests mr (cost=0.43..116,498.93 rows=24,410 width=20) (actual time=0.040..756.128 rows=1,905 loops=1)

  • Index Cond: (parent_maintenance_request_id IS NULL)
  • Filter: ((cid IS NOT NULL) AND (deleted_on IS NULL) AND (cid = 235) AND (maintenance_request_type_id = 1))
  • Rows Removed by Filter: 2,110,229
57. 0.015 0.406 ↑ 1.0 79 1

Hash (cost=76.33..76.33 rows=80 width=12) (actual time=0.406..0.406 rows=79 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
58. 0.391 0.391 ↑ 1.0 79 1

Seq Scan on maintenance_statuses ms (cost=0.00..76.33 rows=80 width=12) (actual time=0.015..0.391 rows=79 loops=1)

  • Filter: (cid = 235)
  • Rows Removed by Filter: 589
59. 2.887 11.428 ↓ 252.0 6,804 1

Sort (cost=747.69..747.76 rows=27 width=48) (actual time=9.676..11.428 rows=6,804 loops=1)

  • Sort Key: ocus_1.unit_space_id
  • Sort Method: quicksort Memory: 1,079kB
60. 0.655 8.541 ↓ 107.1 2,891 1

Hash Join (cost=566.46..747.05 rows=27 width=48) (actual time=6.788..8.541 rows=2,891 loops=1)

  • Hash Cond: (ocus_1.organization_contract_id = oc.id)
61. 1.152 1.152 ↑ 1.1 2,931 1

Seq Scan on organization_contract_unit_spaces ocus_1 (cost=0.00..168.62 rows=3,101 width=12) (actual time=0.036..1.152 rows=2,931 loops=1)

  • Filter: ((deleted_on IS NULL) AND (cid = 235))
  • Rows Removed by Filter: 4,102
62. 0.134 6.734 ↓ 75.2 376 1

Hash (cost=566.39..566.39 rows=5 width=48) (actual time=6.734..6.734 rows=376 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 106kB
63. 1.032 6.600 ↓ 75.2 376 1

Nested Loop (cost=58.47..566.39 rows=5 width=48) (actual time=0.928..6.600 rows=376 loops=1)

64. 0.335 3.312 ↓ 20.9 376 1

Nested Loop (cost=58.05..424.20 rows=18 width=32) (actual time=0.865..3.312 rows=376 loops=1)

65. 0.211 2.601 ↓ 15.7 376 1

Hash Join (cost=57.90..418.88 rows=24 width=24) (actual time=0.828..2.601 rows=376 loops=1)

  • Hash Cond: (lsw_1.id = oc.lease_start_window_id)
66. 1.615 1.727 ↑ 1.6 938 1

Bitmap Heap Scan on lease_start_windows lsw_1 (cost=32.78..388.00 rows=1,475 width=16) (actual time=0.140..1.727 rows=938 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
67. 0.112 0.112 ↓ 1.1 1,842 1

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

  • Index Cond: (cid = 235)
68. 0.065 0.663 ↓ 1.0 376 1

Hash (cost=20.49..20.49 rows=370 width=20) (actual time=0.663..0.663 rows=376 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
69. 0.598 0.598 ↓ 1.0 376 1

Seq Scan on organization_contracts oc (cost=0.00..20.49 rows=370 width=20) (actual time=0.018..0.598 rows=376 loops=1)

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

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=376)

  • Index Cond: ((cid = 235) AND (id = oc.organization_id))
71. 2.256 2.256 ↑ 1.0 1 376

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

  • Index Cond: ((cid = 235) AND (id = o.customer_id))
72. 251.068 1,097.744 ↓ 0.0 0 57,776

Nested Loop Left Join (cost=2.96..20.78 rows=5 width=72) (actual time=0.018..0.019 rows=0 loops=57,776)

  • Join Filter: (ocus.organization_contract_id = lsw.organization_contract_id)
  • Rows Removed by Join Filter: 0
73. 0.000 808.864 ↓ 0.0 0 57,776

Nested Loop Left Join (cost=2.68..19.10 rows=5 width=100) (actual time=0.014..0.014 rows=0 loops=57,776)

  • Join Filter: ((lt.cid = lsw.cid) AND (lt.id = lsw.lease_term_id) AND (lsw.property_id = cl.property_id))
74. 77.740 808.864 ↓ 0.0 0 57,776

Nested Loop (cost=2.39..17.42 rows=5 width=96) (actual time=0.013..0.014 rows=0 loops=57,776)

75. 65.136 693.312 ↓ 0.0 0 57,776

Nested Loop Left Join (cost=2.10..17.09 rows=1 width=88) (actual time=0.012..0.012 rows=0 loops=57,776)

76. 0.000 577.760 ↓ 0.0 0 57,776

Nested Loop Left Join (cost=1.68..14.95 rows=1 width=86) (actual time=0.010..0.010 rows=0 loops=57,776)

77. 61.456 519.984 ↓ 0.0 0 57,776

Nested Loop (cost=1.26..14.21 rows=1 width=82) (actual time=0.008..0.009 rows=0 loops=57,776)

  • 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: 0
78. 47.932 404.432 ↓ 0.0 0 57,776

Nested Loop (cost=0.84..12.67 rows=1 width=82) (actual time=0.007..0.007 rows=0 loops=57,776)

79. 288.880 288.880 ↓ 0.0 0 57,776

Index Scan using idx_cached_leases_unit_space_id on cached_leases cl (cost=0.42..11.17 rows=1 width=54) (actual time=0.005..0.005 rows=0 loops=57,776)

  • Index Cond: (unit_space_id = us.id)
  • Filter: ((cid = 235) AND (cid = us.cid) AND (property_id = us.property_id) AND (lease_status_type_id = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
80. 67.620 67.620 ↑ 1.0 1 13,524

Index Scan using pk_lease_intervals on lease_intervals li (cost=0.42..1.49 rows=1 width=28) (actual time=0.005..0.005 rows=1 loops=13,524)

  • Index Cond: ((cid = 235) AND (id = cl.active_lease_interval_id))
  • Filter: (cl.id = lease_id)
81. 54.096 54.096 ↑ 1.0 1 13,524

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.004..0.004 rows=1 loops=13,524)

  • Index Cond: (lease_interval_id = li.id)
  • Filter: ((cid = 235) AND (li.lease_id = lease_id))
82. 63.020 63.020 ↑ 1.0 1 12,604

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.004..0.005 rows=1 loops=12,604)

  • Index Cond: (lease_id = cl.id)
  • Filter: ((cid = 235) AND (cl.cid = cid) AND (unit_space_id = cl.unit_space_id))
83. 50.416 50.416 ↑ 1.0 1 12,604

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=12,604)

  • Index Cond: (id = cl.primary_customer_id)
  • Filter: ((cid = 235) AND (cl.cid = cid))
84. 37.812 37.812 ↑ 1.0 1 12,604

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

  • Index Cond: ((cid = 235) AND (id = li.lease_term_id))
85. 12.604 12.604 ↓ 0.0 0 12,604

Index Scan using pk_lease_start_windows on lease_start_windows lsw (cost=0.29..0.32 rows=1 width=28) (actual time=0.001..0.001 rows=0 loops=12,604)

  • Index Cond: ((cid = 235) AND (id = li.lease_start_window_id))
  • Filter: ((deleted_on IS NULL) AND (is_active IS TRUE))
86. 37.812 37.812 ↓ 0.0 0 12,604

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.003..0.003 rows=0 loops=12,604)

  • Index Cond: (unit_space_id = cl.unit_space_id)
  • Filter: ((cid = 235) AND (cid = cl.cid))
87. 0.069 489.685 ↓ 93.0 93 1

Sort (cost=149,287.89..149,287.90 rows=1 width=52) (actual time=489.628..489.685 rows=93 loops=1)

  • Sort Key: st.unit_space_id
  • Sort Method: quicksort Memory: 25kB
88. 0.017 489.616 ↓ 2.0 2 1

Subquery Scan on st (cost=149,287.81..149,287.88 rows=1 width=52) (actual time=489.605..489.616 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
89. 0.045 489.599 ↓ 6.0 6 1

WindowAgg (cost=149,287.81..149,287.86 rows=1 width=64) (actual time=489.585..489.599 rows=6 loops=1)

90. 0.074 489.554 ↓ 6.0 6 1

Sort (cost=149,287.81..149,287.81 rows=1 width=631) (actual time=489.554..489.554 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
91. 451.369 489.480 ↓ 6.0 6 1

Bitmap Heap Scan on scheduled_tasks st_1 (cost=6,789.28..149,287.80 rows=1 width=631) (actual time=72.466..489.480 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
92. 38.111 38.111 ↑ 1.0 365,170 1

Bitmap Index Scan on pk_scheduled_tasks (cost=0.00..6,789.28 rows=367,047 width=0) (actual time=38.110..38.111 rows=365,170 loops=1)

  • Index Cond: (cid = 235)