explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4tGb

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 432.104 28,303.932 ↓ 28.9 28,888 1

Hash Left Join (cost=154,011.15..483,623.78 rows=1,000 width=91) (actual time=472.146..28,303.932 rows=28,888 loops=1)

  • Output: (generate_series.generate_series)::date, us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, COALESCE(us.occupancy_type_id, 1), pu.gender_id, (CASE WHEN (count(*) > 0) THEN true ELSE false END), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (CASE WHEN (count(*) > 0) THEN true ELSE false END), CASE WHEN ((laus.available_on <= GREATEST((generate_series.generate_series)::date, CURRENT_DATE)) AND COALESCE(((((to_jsonb(ROW(st.unit_exclusion_reason_type_id, st.scheduled_start_date, st.scheduled_end_date))) ->> 'unit_exclusion_reason_type_id'::text))::integer = 1), true)) THEN true ELSE false END, COALESCE((((generate_series.generate_series)::date >= laus.window_start_on) AND ((generate_series.generate_series)::date <= laus.window_end_on)), false), CASE WHEN ((generate_series.generate_series)::date <= us.reserve_until) THEN true ELSE false END, COALESCE(((lt.lease_term_type_id = 2) AND ((generate_series.generate_series)::date >= lsw.start_date) AND ((generate_series.generate_series)::date <= lsw.end_date)), false), COALESCE(((lt.lease_term_type_id = 3) AND ((generate_series.generate_series)::date >= cl.lease_start_date) AND ((generate_series.generate_series)::date <= cl.lease_end_date)), false), us.is_marketed, false, jsonb_build_object('available_windows', (to_jsonb(array_agg(DISTINCT lsw_2.id))), 'available_terms', (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), 'specials', (json_agg(s.id)), 'amenities', (json_agg(a.id)), 'leases', (to_jsonb(ROW(cl.id, li.id, li.lease_term_id, li.lease_start_window_id, cl.lease_status_type_id, ca.application_stage_id, ca.application_status_id, lus.id, ocus.id, cl.move_in_date, cl.name_first, cl.name_last, c.gender, c.id, lt.lease_term_type_id, lsw.start_date, lsw.end_date, cl.lease_start_date, cl.lease_end_date))), 'contract', (to_jsonb(ROW(o.id, oc.id, oc.organization_contract_status_type_id, lsw_1.start_date, lsw_1.end_date, c_1.company_name))), 'make_ready', (to_jsonb(ROW(mr.id, (mrd.scheduled_start_datetime)::date, (mrd.scheduled_end_datetime)::date))), 'unit_exclusion_reason', COALESCE((to_jsonb(ROW(st.unit_exclusion_reason_type_id, st.scheduled_start_date, st.scheduled_end_date))), jsonb_build_object('unit_exclusion_reason_type_id', us.unit_exclusion_reason_type_id, 'scheduled_start_date', NULL::unknown, 'scheduled_end_date', NULL::unknown))), 1, now(), false
  • Hash Cond: ((us.cid = st.cid) AND (us.property_id = st.property_id) AND (us.id = st.unit_space_id))
  • Join Filter: (((generate_series.generate_series)::date >= st.scheduled_start_date) AND ((generate_series.generate_series)::date <= st.scheduled_end_date))
  • Buffers: shared hit=2,331,792 read=74 dirtied=3, local hit=253 dirtied=253 written=253
2. 535.547 27,557.792 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=703.59..330,234.95 rows=1,000 width=312) (actual time=158.069..27,557.792 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(a.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(s.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), cl.lease_start_date, cl.lease_end_date, lt.lease_term_type_id, lsw.start_date, lsw.end_date, (to_jsonb(ROW(cl.id, li.id, li.lease_term_id, li.lease_start_window_id, cl.lease_status_type_id, ca.application_stage_id, ca.application_status_id, lus.id, ocus.id, cl.move_in_date, cl.name_first, cl.name_last, c.gender, c.id, lt.lease_term_type_id, lsw.start_date, lsw.end_date, cl.lease_start_date, cl.lease_end_date))), (to_jsonb(ROW(o.id, oc.id, oc.organization_contract_status_type_id, lsw_1.start_date, lsw_1.end_date, c_1.company_name))), (to_jsonb(ROW(mr.id, (mrd.scheduled_start_datetime)::date, (mrd.scheduled_end_datetime)::date)))
  • 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: 4,243,455
  • Buffers: shared hit=2,241,879 read=74 dirtied=3, local hit=253 dirtied=253 written=253
3. 42.738 26,733.365 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=700.64..329,860.62 rows=1,000 width=260) (actual time=153.208..26,733.365 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(a.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(s.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (to_jsonb(ROW(o.id, oc.id, oc.organization_contract_status_type_id, lsw_1.start_date, lsw_1.end_date, c_1.company_name))), (to_jsonb(ROW(mr.id, (mrd.scheduled_start_datetime)::date, (mrd.scheduled_end_datetime)::date)))
  • Join Filter: ((mr.cid = us.cid) AND (mr.property_id = us.property_id) AND (mr.unit_space_id = us.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: 259,992
  • Buffers: shared hit=2,238,219 read=74 dirtied=3, local hit=253 dirtied=253 written=253
4. 7,672.207 26,661.739 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=699.50..328,279.90 rows=1,000 width=228) (actual time=153.064..26,661.739 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(a.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(s.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (to_jsonb(ROW(o.id, oc.id, oc.organization_contract_status_type_id, lsw_1.start_date, lsw_1.end_date, c_1.company_name)))
  • Join Filter: ((oc.cid = us.cid) AND (ocus_1.unit_space_id = us.id) 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: 82,647,546
  • Buffers: shared hit=2,238,141 read=74 dirtied=3, local hit=253 dirtied=253 written=253
5. 40.382 14,136.348 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=694.16..328,192.05 rows=1,000 width=196) (actual time=127.560..14,136.348 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(a.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(s.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END)
  • Buffers: shared hit=2,214,445 read=74 dirtied=3, local hit=253 dirtied=253 written=253
6. 26.230 13,315.990 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=673.34..307,346.55 rows=1,000 width=203) (actual time=127.504..13,315.990 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, pf.cid, pf.property_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(a.id)), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(s.id))
  • Buffers: shared hit=1,942,861 read=74 dirtied=3, local hit=253 dirtied=253 written=253
7. 35.121 2,861.192 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=421.38..55,354.69 rows=1,000 width=170) (actual time=126.742..2,861.192 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, pf.cid, pf.property_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END))), (CASE WHEN (count(*) > 0) THEN true ELSE false END), (json_agg(a.id))
  • Buffers: shared hit=960,670 read=73 dirtied=3, local hit=253 dirtied=253 written=253
8. 47.733 1,930.543 ↓ 28.9 28,888 1

Nested Loop Left Join (cost=392.19..26,128.17 rows=1,000 width=137) (actual time=125.403..1,930.543 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, pf.cid, pf.property_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on, (to_jsonb(array_agg(DISTINCT lsw_2.id))), (to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END)))
  • Buffers: shared hit=689,159 dirtied=3, local hit=253 dirtied=253 written=253
9. 51.806 207.306 ↓ 28.9 28,888 1

Hash Left Join (cost=367.12..1,018.17 rows=1,000 width=73) (actual time=125.236..207.306 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, pf.cid, pf.property_id, generate_series.generate_series, laus.available_on, laus.window_start_on, laus.window_end_on
  • Hash Cond: ((us.cid = laus.cid) AND (us.id = laus.unit_space_id) AND ((generate_series.generate_series)::date = laus.move_in_date))
  • Buffers: shared hit=23,479 dirtied=3, local hit=253 dirtied=253 written=253
10. 11.755 31.589 ↓ 28.9 28,888 1

Nested Loop (cost=366.22..1,004.77 rows=1,000 width=61) (actual time=1.288..31.589 rows=28,888 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, pf.cid, pf.property_id, generate_series.generate_series
  • Buffers: shared hit=1,305
11. 1.230 8.530 ↓ 314.0 314 1

Nested Loop (cost=366.22..984.76 rows=1 width=53) (actual time=1.257..8.530 rows=314 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pu.gender_id, pf.cid, pf.property_id
  • Inner Unique: true
  • Buffers: shared hit=1,305
12. 0.863 3.846 ↓ 13.7 314 1

Hash Join (cost=365.92..806.71 rows=23 width=49) (actual time=1.244..3.846 rows=314 loops=1)

  • Output: us.cid, us.property_id, us.property_floorplan_id, us.unit_type_id, us.property_unit_id, us.id, us.occupancy_type_id, us.reserve_until, us.is_marketed, us.unit_exclusion_reason_type_id, pf.cid, pf.property_id
  • Inner Unique: true
  • Hash Cond: (us.property_floorplan_id = pf.id)
  • Buffers: shared hit=363
13. 1.775 1.810 ↓ 3.8 314 1

Bitmap Heap Scan on public.unit_spaces us (cost=5.71..446.28 rows=83 width=41) (actual time=0.060..1.810 rows=314 loops=1)

  • Output: us.id, us.cid, us.property_id, us.unit_kind_id, us.unit_type_id, us.property_building_id, us.property_floorplan_id, us.property_floor_id, us.property_unit_id, us.unit_space_log_type_id, us.unit_space_status_type_id, us.unit_exclusion_reason_type_id, us.occupancy_type_id, us.late_fee_formula_id, us.application_lease_id, us.hold_lease_id, us.future_lease_id, us.current_lease_id, us.past_lease_id, us.rate_adjustment_type_id, us.rate_adjustment_unit_id, us.reference_id, us.reference_log_id, us.remote_primary_key, us.property_name, us.building_name, us.marketing_unit_number, us.marketing_unit_number_cache, us.unit_number, us.unit_number_cache, us.space_number, us.display_number, us.initial_rent, us.budgeted_base_rent, us.budgeted_amenity_rent, us.budgeted_rent, us.rate_adjustment_amount, us.make_ready_notes, us.reporting_start_month, us.post_to_logs, us.show_on_website, us.is_marketed, us.is_available, us.is_reportable, us.is_pricing_synced, us.order_num, us.details, us.move_out_date, us.reserve_until, us.available_on, us.make_ready_date, us.imported_on, us.vacated_on, us.deleted_by, us.deleted_on, us.updated_by, us.updated_on, us.created_by, us.created_on
  • Recheck Cond: ((us.cid = 235) AND (us.property_id = 719,642))
  • Filter: ((us.deleted_on IS NULL) AND (us.occupancy_type_id <> 2))
  • Rows Removed by Filter: 48
  • Heap Blocks: exact=174
  • Buffers: shared hit=191
14. 0.035 0.035 ↓ 3.0 377 1

Bitmap Index Scan on idx_unit_spaces_company_property_id (cost=0.00..5.69 rows=127 width=0) (actual time=0.035..0.035 rows=377 loops=1)

  • Index Cond: ((us.cid = 235) AND (us.property_id = 719,642))
  • Buffers: shared hit=3
15. 0.325 1.173 ↑ 1.0 2,322 1

Hash (cost=330.85..330.85 rows=2,349 width=12) (actual time=1.173..1.173 rows=2,322 loops=1)

  • Output: pf.cid, pf.property_id, pf.id
  • Buckets: 4,096 Batches: 1 Memory Usage: 132kB
  • Buffers: shared hit=172
16. 0.736 0.848 ↑ 1.0 2,322 1

Bitmap Heap Scan on public.property_floorplans pf (cost=50.49..330.85 rows=2,349 width=12) (actual time=0.131..0.848 rows=2,322 loops=1)

  • Output: pf.cid, pf.property_id, pf.id
  • Recheck Cond: (pf.cid = 235)
  • Heap Blocks: exact=164
  • Buffers: shared hit=172
17. 0.112 0.112 ↑ 1.0 2,325 1

Bitmap Index Scan on pk_property_floorplans (cost=0.00..49.90 rows=2,349 width=0) (actual time=0.112..0.112 rows=2,325 loops=1)

  • Index Cond: (pf.cid = 235)
  • Buffers: shared hit=8
18. 3.454 3.454 ↑ 1.0 1 314

Index Scan using pk_property_units on public.property_units pu (cost=0.29..7.74 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=314)

  • Output: pu.id, pu.cid, pu.property_id, pu.property_building_id, pu.unit_type_id, pu.unit_kind_id, pu.property_floorplan_id, pu.property_floor_id, pu.gender_id, pu.remote_primary_key, pu.marketing_unit_number, pu.unit_number, pu.style, pu.square_feet, pu.max_occupants, pu.max_pets, pu.number_of_bedrooms, pu.number_of_bathrooms, pu.carpet_color, pu.unit_coordinates, pu.site_plan_x_pos, pu.site_plan_y_pos, pu.floor_x_pos, pu.floor_y_pos, pu.details, pu.block_integration, pu.block_pricing_integration, pu.is_furnished, pu.is_smart, pu.order_num, pu.imported_on, pu.deleted_by, pu.deleted_on, pu.updated_by, pu.updated_on, pu.created_by, pu.created_on, pu.military_neighborhood_code
  • Index Cond: ((pu.cid = 235) AND (pu.id = us.property_unit_id))
  • Filter: (pu.property_id = 719,642)
  • Buffers: shared hit=942
19. 11.304 11.304 ↑ 10.9 92 314

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

  • Output: generate_series.generate_series
  • Function Call: generate_series(('2020-07-30'::date)::timestamp with time zone, ('2020-10-29'::date)::timestamp with time zone, '1 day'::interval)
20. 5.654 123.911 ↓ 27,048.0 27,048 1

Hash (cost=0.88..0.88 rows=1 width=24) (actual time=123.911..123.911 rows=27,048 loops=1)

  • Output: laus.available_on, laus.window_start_on, laus.window_end_on, laus.cid, laus.unit_space_id, laus.move_in_date
  • Buckets: 32,768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1,736kB
  • Buffers: shared hit=22,171 dirtied=3, local hit=253 dirtied=253 written=253
21. 118.257 118.257 ↓ 27,048.0 27,048 1

Function Scan on public.load_available_unit_spaces laus (cost=0.25..0.88 rows=1 width=24) (actual time=113.967..118.257 rows=27,048 loops=1)

  • Output: laus.available_on, laus.window_start_on, laus.window_end_on, laus.cid, laus.unit_space_id, laus.move_in_date
  • Function Call: load_available_unit_spaces(235, '{719642}'::integer[], '{}'::integer[], '{}'::integer[], '{}'::integer[], '{}'::integer[], '{}'::integer[], '{}'::integer[], '2020-07-30'::date, false, false, true, '2020-10-29'::date, true)
  • Filter: (laus.cid = 235)
  • Buffers: shared hit=22,171 dirtied=3, local hit=253 dirtied=253 written=253
22. 404.432 1,675.504 ↑ 1.0 1 28,888

Aggregate (cost=25.07..25.09 rows=1 width=64) (actual time=0.058..0.058 rows=1 loops=28,888)

  • Output: to_jsonb(array_agg(DISTINCT CASE WHEN (lsw_2.id IS NULL) THEN lt_1.id ELSE NULL::integer END)), to_jsonb(array_agg(DISTINCT lsw_2.id))
  • Buffers: shared hit=665,680
23. 288.880 1,271.072 ↓ 2.8 14 28,888

Nested Loop Left Join (cost=0.86..25.05 rows=5 width=8) (actual time=0.021..0.044 rows=14 loops=28,888)

  • Output: lsw_2.id, lt_1.id
  • 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: 41
  • Buffers: shared hit=665,680
24. 115.552 606.648 ↓ 2.6 13 28,888

Nested Loop (cost=0.57..16.62 rows=5 width=16) (actual time=0.009..0.021 rows=13 loops=28,888)

  • Output: lt_1.id, lt_1.cid, lt_1.lease_term_type_id, pcs.property_id
  • Buffers: shared hit=519,984
25. 115.552 115.552 ↑ 1.0 1 28,888

Index Scan using idx_property_charge_settings_property_id on public.property_charge_settings pcs (cost=0.28..8.30 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=28,888)

  • Output: pcs.id, pcs.cid, pcs.property_id, pcs.lease_term_structure_id, pcs.lease_start_structure_id, pcs.accelerated_rent_type_id, pcs.base_rent_renewal_option_id, pcs.other_fees_renewal_option_id, pcs.lease_end_billing_type_id, pcs.round_type_id, pcs.month_to_month_type_id, pcs.month_to_month_rent_ar_code_id, pcs.enforce_unit_space_unions, pcs.prorate_charges, pcs.ignore_month_to_month_intervals, pcs.use_30_day_month, pcs.temporary_charge_gl_post_day, pcs.charge_move_in_day, pcs.charge_move_out_day, pcs.immediate_move_in_prorate_charges, pcs.immediate_move_in_use_30_day_month, pcs.immediate_move_in_charge_move_in_day, pcs.write_off_accelerated_rent, pcs.auto_post_scheduled_charges, pcs.base_rent_renewal_factor, pcs.other_fees_renewal_factor, pcs.scheduled_charge_auto_post_day, pcs.scheduled_charge_auto_post_through, pcs.post_through_next_month, pcs.show_rent_amount_on_quick_view, pcs.start_renewal_charges_on_first, pcs.start_mtm_charges_on_first, pcs.require_installments, pcs.available_space_limit_days, pcs.on_notice_space_limit_days, pcs.early_display_allowance_days, pcs.show_available_not_ready_spaces, pcs.show_notice_available_spaces, pcs.allow_rate_offsets, pcs.allow_late_fee_overrides, pcs.allow_asset_rates, pcs.allow_equity_rates, pcs.allow_expense_rates, pcs.allow_liability_rates, pcs.allow_pre_qualification_trigger, pcs.allow_application_approval_trigger, pcs.allow_lease_completed_trigger, pcs.allow_lease_approval_trigger, pcs.allow_last_lease_month_trigger, pcs.allow_notice_trigger, pcs.allow_anniversary_of_move_in_trigger, pcs.allow_end_of_year_trigger, pcs.allow_hourly_trigger, pcs.allow_daily_trigger, pcs.allow_weekly_trigger, pcs.allow_every_two_weeks_trigger, pcs.allow_twice_per_month_trigger, pcs.allow_specific_months_trigger, pcs.allow_quarterly_trigger, pcs.allow_twice_per_year_trigger, pcs.allow_yearly_trigger, pcs.allow_screening_approved_trigger, pcs.post_accel_rent_in_current_post_month, pcs.allow_repayment_agreements, pcs.refund_accelerated_rent_at_move_in, pcs.update_all_mtm_to_market_rates, pcs.include_other_in_advertised_rent, pcs.repayment_maximum_allowed_months, pcs.repayment_agreement_ar_code_id, pcs.repayment_allocation_order, pcs.repayment_charge_late_fees_retroactively, pcs.default_mtm_multiplier_lease_term_id, pcs.default_mtm_multiplier, pcs.updated_by, pcs.updated_on, pcs.created_by, pcs.created_on, pcs.allow_repayments_for_active_leases, pcs.use_current_date_for_floorplan_range, pcs.include_tax_in_advertised_rent, pcs.bill_future_leases, pcs.bill_early_move_in, pcs.use_rates_for_early_move_ins, pcs.end_charges_at_notice, pcs.allocate_taxes_proportionately, pcs.bill_early_move_ins_immediately
  • Index Cond: (pcs.property_id = us.property_id)
  • Filter: (pcs.cid = us.cid)
  • Buffers: shared hit=86,664
26. 375.544 375.544 ↓ 13.0 13 28,888

Index Scan using idx_lease_terms_master on public.lease_terms lt_1 (cost=0.29..8.30 rows=1 width=16) (actual time=0.004..0.013 rows=13 loops=28,888)

  • Output: lt_1.id, lt_1.cid, lt_1.lease_term_structure_id, lt_1.default_lease_term_id, lt_1.mapping_plt_id, lt_1.name, lt_1.term_month, lt_1.allow_prospect_edit, lt_1.allow_renewal_edit, lt_1.is_prospect, lt_1.is_renewal, lt_1.is_system, lt_1.is_disabled, lt_1.is_default, lt_1.is_unset, lt_1.show_on_website, lt_1.is_commercial, lt_1.deleted_by, lt_1.deleted_on, lt_1.updated_by, lt_1.updated_on, lt_1.created_by, lt_1.created_on, lt_1.details, lt_1.occupancy_type_id, lt_1.lease_term_type_id
  • Index Cond: ((lt_1.cid = us.cid) AND (lt_1.lease_term_structure_id = pcs.lease_term_structure_id))
  • Filter: (lt_1.deleted_on IS NULL)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=433,320
27. 115.552 375.544 ↓ 3.0 3 375,544

Materialize (cost=0.29..8.32 rows=1 width=16) (actual time=0.001..0.001 rows=3 loops=375,544)

  • Output: lsw_2.id, lsw_2.cid, lsw_2.lease_term_id, lsw_2.property_id
  • Buffers: shared hit=145,696
28. 259.992 259.992 ↓ 3.0 3 28,888

Index Scan using ca_lease_start_windows_idx on public.lease_start_windows lsw_2 (cost=0.29..8.31 rows=1 width=16) (actual time=0.006..0.009 rows=3 loops=28,888)

  • Output: lsw_2.id, lsw_2.cid, lsw_2.lease_term_id, lsw_2.property_id
  • Index Cond: ((lsw_2.cid = us.cid) AND (lsw_2.property_id = us.property_id) AND (lsw_2.end_date >= (generate_series.generate_series)::date))
  • Filter: ((lsw_2.deleted_on IS NULL) AND (lsw_2.is_active IS TRUE))
  • Buffers: shared hit=145,696
29. 28.888 895.528 ↑ 1.0 1 28,888

Aggregate (cost=29.19..29.21 rows=1 width=33) (actual time=0.031..0.031 rows=1 loops=28,888)

  • Output: CASE WHEN (count(*) > 0) THEN true ELSE false END, json_agg(a.id)
  • Buffers: shared hit=271,511 read=73
30. 28.888 866.640 ↓ 0.0 0 28,888

Nested Loop (cost=17.07..29.19 rows=1 width=4) (actual time=0.030..0.030 rows=0 loops=28,888)

  • Output: a.id
  • Inner Unique: true
  • Buffers: shared hit=271,511 read=73
31. 57.776 837.752 ↓ 0.0 0 28,888

Bitmap Heap Scan on public.rate_associations ra (cost=16.79..20.81 rows=1 width=8) (actual time=0.029..0.029 rows=0 loops=28,888)

  • Output: ra.id, ra.cid, ra.property_id, ra.property_floorplan_id, ra.unit_type_id, ra.unit_space_id, ra.ar_cascade_id, ra.ar_cascade_reference_id, ra.ar_origin_id, ra.ar_origin_reference_id, ra.company_media_file_id, ra.remote_primary_key, ra.external_video_url, ra.description, ra.notes, ra.pet_restrictions, ra.pet_weight_limit, ra.pet_max_allowed, ra.pet_care, ra.hide_description, ra.is_pet_to_all_units, ra.is_default, ra.is_itemized, ra.is_featured, ra.is_optional, ra.is_published, ra.hide_rates, ra.expires_on, ra.order_num, ra.imported_on, ra.updated_by, ra.updated_on, ra.created_by, ra.created_on, ra.mapping_id, ra.details
  • Recheck Cond: ((ra.ar_cascade_reference_id = us.id) AND (ra.property_id = pf.property_id))
  • Filter: ((ra.cid = pf.cid) AND (ra.ar_origin_id = 2) AND (ra.ar_cascade_id = 4))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=40,480
  • Buffers: shared hit=271,511 read=73
32. 28.888 779.976 ↓ 0.0 0 28,888

BitmapAnd (cost=16.79..16.79 rows=1 width=0) (actual time=0.027..0.027 rows=0 loops=28,888)

  • Buffers: shared hit=231,072 read=32
33. 86.664 86.664 ↑ 7.0 1 28,888

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=1 loops=28,888)

  • Index Cond: (ra.ar_cascade_reference_id = us.id)
  • Buffers: shared hit=86,636 read=28
34. 664.424 664.424 ↓ 1.1 554 28,888

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..12.06 rows=486 width=0) (actual time=0.023..0.023 rows=554 loops=28,888)

  • Index Cond: (ra.property_id = pf.property_id)
  • Buffers: shared hit=144,436 read=4
35. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pk_amenities on public.amenities a (cost=0.28..8.30 rows=1 width=8) (never executed)

  • Output: a.cid, a.id
  • Index Cond: ((a.cid = pf.cid) AND (a.id = ra.ar_origin_reference_id))
  • Heap Fetches: 0
36. 28.888 10,428.568 ↑ 1.0 1 28,888

Aggregate (cost=251.96..251.97 rows=1 width=33) (actual time=0.361..0.361 rows=1 loops=28,888)

  • Output: CASE WHEN (count(*) > 0) THEN true ELSE false END, json_agg(s.id)
  • Buffers: shared hit=982,191 read=1
37. 28.888 10,399.680 ↓ 0.0 0 28,888

Nested Loop (cost=166.35..251.95 rows=1 width=4) (actual time=0.360..0.360 rows=0 loops=28,888)

  • Output: s.id
  • Inner Unique: true
  • Buffers: shared hit=982,191 read=1
38. 86.664 10,255.240 ↑ 1.0 1 28,888

Bitmap Heap Scan on public.rate_associations ra_1 (cost=166.06..241.84 rows=1 width=8) (actual time=0.355..0.355 rows=1 loops=28,888)

  • Output: ra_1.id, ra_1.cid, ra_1.property_id, ra_1.property_floorplan_id, ra_1.unit_type_id, ra_1.unit_space_id, ra_1.ar_cascade_id, ra_1.ar_cascade_reference_id, ra_1.ar_origin_id, ra_1.ar_origin_reference_id, ra_1.company_media_file_id, ra_1.remote_primary_key, ra_1.external_video_url, ra_1.description, ra_1.notes, ra_1.pet_restrictions, ra_1.pet_weight_limit, ra_1.pet_max_allowed, ra_1.pet_care, ra_1.hide_description, ra_1.is_pet_to_all_units, ra_1.is_default, ra_1.is_itemized, ra_1.is_featured, ra_1.is_optional, ra_1.is_published, ra_1.hide_rates, ra_1.expires_on, ra_1.order_num, ra_1.imported_on, ra_1.updated_by, ra_1.updated_on, ra_1.created_by, ra_1.created_on, ra_1.mapping_id, ra_1.details
  • Recheck Cond: ((ra_1.property_id = us.property_id) AND (ra_1.ar_origin_id = 6))
  • Filter: (ra_1.cid = us.cid)
  • Heap Blocks: exact=28,888
  • Buffers: shared hit=895,528
39. 115.552 10,168.576 ↓ 0.0 0 28,888

BitmapAnd (cost=166.06..166.06 rows=20 width=0) (actual time=0.352..0.352 rows=0 loops=28,888)

  • Buffers: shared hit=866,640
40. 606.648 606.648 ↓ 1.1 554 28,888

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..12.06 rows=486 width=0) (actual time=0.021..0.021 rows=554 loops=28,888)

  • Index Cond: (ra_1.property_id = us.property_id)
  • Buffers: shared hit=144,440
41. 9,446.376 9,446.376 ↑ 1.0 8,001 28,888

Bitmap Index Scan on idx_rate_associations_ar_origin_id (cost=0.00..153.75 rows=8,177 width=0) (actual time=0.327..0.327 rows=8,001 loops=28,888)

  • Index Cond: (ra_1.ar_origin_id = 6)
  • Buffers: shared hit=722,200
42. 115.552 115.552 ↓ 0.0 0 28,888

Index Scan using pk_specials on public.specials s (cost=0.28..8.32 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=28,888)

  • Output: s.id, s.cid, s.special_recipient_id, s.special_type_id, s.special_group_id, s.company_media_file_id, s.application_stage_status_id, s.remote_primary_key, s.name, s.description, s.notes, s.details, s.start_date, s.end_date, s.min_days_to_lease_start, s.max_days_to_lease_start, s.gift_value, s.recurring_payment_day_restriction, s.coupon_code, s.coupon_code_required, s.quantity_budgeted, s.quantity_remaining, s.limit_quantity, s.hide_end_date, s.is_system, s.is_active, s.is_default, s.show_on_website, s.is_auto_fulfilled, s.order_num, s.deleted_by, s.deleted_on, s.updated_by, s.updated_on, s.created_by, s.created_on, s.import_renewal_template_tier_id
  • Index Cond: ((s.cid = us.cid) AND (s.id = ra_1.ar_origin_reference_id))
  • Filter: ((NOT s.coupon_code_required) AND s.show_on_website AND s.is_active AND (s.deleted_on IS NULL) AND (s.special_type_id <> 5) AND (s.special_recipient_id = 2) AND ((generate_series.generate_series)::date >= COALESCE(s.start_date, (generate_series.generate_series)::date)) AND ((generate_series.generate_series)::date <= COALESCE(s.end_date, (generate_series.generate_series)::date)))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=86,663 read=1
43. 28.888 779.976 ↑ 1.0 1 28,888

Aggregate (cost=20.81..20.83 rows=1 width=1) (actual time=0.027..0.027 rows=1 loops=28,888)

  • Output: CASE WHEN (count(*) > 0) THEN true ELSE false END
  • Buffers: shared hit=271,584
44. 57.776 751.088 ↑ 1.0 1 28,888

Bitmap Heap Scan on public.rate_associations ra_2 (cost=16.79..20.81 rows=1 width=0) (actual time=0.025..0.026 rows=1 loops=28,888)

  • Recheck Cond: ((ra_2.ar_cascade_reference_id = us.id) AND (ra_2.property_id = pf.property_id))
  • Filter: ((ra_2.cid = pf.cid) AND (ra_2.ar_origin_id = 3) AND (ra_2.ar_cascade_id = 4))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=40,480
  • Buffers: shared hit=271,584
45. 28.888 693.312 ↓ 0.0 0 28,888

BitmapAnd (cost=16.79..16.79 rows=1 width=0) (actual time=0.024..0.024 rows=0 loops=28,888)

  • Buffers: shared hit=231,104
46. 57.776 57.776 ↑ 7.0 1 28,888

Bitmap Index Scan on idx_rate_associations_rate_cascade_reference_id (cost=0.00..4.47 rows=7 width=0) (actual time=0.002..0.002 rows=1 loops=28,888)

  • Index Cond: (ra_2.ar_cascade_reference_id = us.id)
  • Buffers: shared hit=86,664
47. 606.648 606.648 ↓ 1.1 554 28,888

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..12.06 rows=486 width=0) (actual time=0.021..0.021 rows=554 loops=28,888)

  • Index Cond: (ra_2.property_id = pf.property_id)
  • Buffers: shared hit=144,440
48. 4,828.345 4,853.184 ↓ 2,861.0 2,861 28,888

Materialize (cost=5.35..60.36 rows=1 width=48) (actual time=0.000..0.168 rows=2,861 loops=28,888)

  • Output: oc.cid, ocus_1.unit_space_id, lsw_1.start_date, lsw_1.end_date, (to_jsonb(ROW(o.id, oc.id, oc.organization_contract_status_type_id, lsw_1.start_date, lsw_1.end_date, c_1.company_name)))
  • Buffers: shared hit=23,696
49. 7.496 24.839 ↓ 2,861.0 2,861 1

Nested Loop (cost=5.35..60.35 rows=1 width=48) (actual time=0.093..24.839 rows=2,861 loops=1)

  • Output: oc.cid, ocus_1.unit_space_id, lsw_1.start_date, lsw_1.end_date, to_jsonb(ROW(o.id, oc.id, oc.organization_contract_status_type_id, lsw_1.start_date, lsw_1.end_date, c_1.company_name))
  • Inner Unique: true
  • Buffers: shared hit=23,696
50. 0.774 11.621 ↓ 2,861.0 2,861 1

Nested Loop (cost=4.93..51.91 rows=1 width=36) (actual time=0.067..11.621 rows=2,861 loops=1)

  • Output: oc.cid, oc.id, oc.organization_contract_status_type_id, ocus_1.unit_space_id, lsw_1.start_date, lsw_1.end_date, o.cid, o.id, o.customer_id
  • Inner Unique: true
  • Buffers: shared hit=12,207
51. 0.755 5.125 ↓ 2,861.0 2,861 1

Nested Loop (cost=4.64..43.59 rows=1 width=32) (actual time=0.049..5.125 rows=2,861 loops=1)

  • Output: oc.cid, oc.id, oc.lease_start_window_id, oc.organization_contract_status_type_id, ocus_1.unit_space_id, o.cid, o.id, o.customer_id
  • Buffers: shared hit=2,148
52. 0.197 2.610 ↓ 352.0 352 1

Nested Loop (cost=0.28..14.63 rows=1 width=28) (actual time=0.030..2.610 rows=352 loops=1)

  • Output: oc.cid, oc.id, oc.lease_start_window_id, oc.organization_contract_status_type_id, o.cid, o.id, o.customer_id
  • Buffers: shared hit=1,074
53. 0.061 0.061 ↓ 196.0 196 1

Seq Scan on public.organizations o (cost=0.00..6.30 rows=1 width=12) (actual time=0.010..0.061 rows=196 loops=1)

  • Output: o.id, o.cid, o.customer_id, o.is_archived, o.updated_by, o.updated_on, o.created_by, o.created_on
  • Filter: (o.cid = 235)
  • Rows Removed by Filter: 68
  • Buffers: shared hit=3
54. 2.352 2.352 ↓ 2.0 2 196

Index Scan using ukey_organization_contracts_name on public.organization_contracts oc (cost=0.28..8.32 rows=1 width=20) (actual time=0.009..0.012 rows=2 loops=196)

  • Output: oc.id, oc.cid, oc.property_id, oc.customer_id, oc.organization_id, oc.organization_contract_status_type_id, oc.organization_contract_financial_responsibility_type_id, oc.company_application_id, oc.lease_start_window_id, oc.name, oc.reservation_code, oc.updated_by, oc.updated_on, oc.created_by, oc.created_on, oc.details, oc.primary_customer_relationship_id
  • Index Cond: ((oc.cid = 235) AND (oc.organization_id = o.id))
  • Filter: (oc.organization_contract_status_type_id = ANY ('{1,2}'::integer[]))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=1,071
55. 1.056 1.760 ↓ 1.1 8 352

Bitmap Heap Scan on public.organization_contract_unit_spaces ocus_1 (cost=4.36..28.89 rows=7 width=12) (actual time=0.003..0.005 rows=8 loops=352)

  • Output: ocus_1.id, ocus_1.cid, ocus_1.organization_contract_id, ocus_1.unit_space_id, ocus_1.deleted_by, ocus_1.deleted_on, ocus_1.updated_by, ocus_1.updated_on, ocus_1.created_by, ocus_1.created_on, ocus_1.property_id
  • Recheck Cond: ((ocus_1.cid = 235) AND (ocus_1.organization_contract_id = oc.id))
  • Filter: (ocus_1.deleted_on IS NULL)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=359
  • Buffers: shared hit=1,074
56. 0.704 0.704 ↓ 1.1 9 352

Bitmap Index Scan on ca_organization_contract_unit_spaces_idx (cost=0.00..4.36 rows=8 width=0) (actual time=0.002..0.002 rows=9 loops=352)

  • Index Cond: ((ocus_1.cid = 235) AND (ocus_1.organization_contract_id = oc.id))
  • Buffers: shared hit=715
57. 5.722 5.722 ↑ 1.0 1 2,861

Index Scan using pk_lease_start_windows on public.lease_start_windows lsw_1 (cost=0.29..8.31 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=2,861)

  • Output: lsw_1.id, lsw_1.cid, lsw_1.lease_start_structure_id, lsw_1.default_lease_start_window_id, lsw_1.property_id, lsw_1.lease_term_id, lsw_1.offset_start_days, lsw_1.offset_end_days, lsw_1.start_date, lsw_1.end_date, lsw_1.billing_end_date, lsw_1.renewal_start_date, lsw_1.renewal_billing_start_date, lsw_1.is_active, lsw_1.is_default, lsw_1.deleted_by, lsw_1.deleted_on, lsw_1.updated_by, lsw_1.updated_on, lsw_1.created_by, lsw_1.created_on, lsw_1.organization_contract_id, lsw_1.lease_extension_date, lsw_1.occupancy_type_id, lsw_1.min_days, lsw_1.max_days, lsw_1.lease_term_type_id, lsw_1.show_on_website
  • Index Cond: ((lsw_1.cid = 235) AND (lsw_1.id = oc.lease_start_window_id))
  • Filter: ((lsw_1.deleted_on IS NULL) AND (lsw_1.is_active IS TRUE))
  • Buffers: shared hit=10,059
58. 5.722 5.722 ↑ 1.0 1 2,861

Index Scan using pk_customers on public.customers c_1 (cost=0.42..8.44 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=2,861)

  • Output: c_1.id, c_1.cid, c_1.integration_database_id, c_1.lead_source_id, c_1.leasing_agent_id, c_1.message_operator_id, c_1.payment_allowance_type_id, c_1.marital_status_type_id, c_1.company_identification_type_id, c_1.primary_phone_number_type_id, c_1.secondary_phone_number_type_id, c_1.remote_primary_key, c_1.secondary_number, c_1.company_name, c_1.name_prefix, c_1.name_first, c_1.name_middle, c_1.name_last, c_1.name_suffix, c_1.name_maiden, c_1.name_spouse, c_1.primary_street_line1, c_1.primary_street_line2, c_1.primary_street_line3, c_1.primary_city, c_1.primary_state_code, c_1.primary_postal_code, c_1.primary_country_code, c_1.primary_is_verified, c_1.phone_number, c_1.mobile_number, c_1.work_number, c_1.fax_number, c_1.email_address, c_1.tax_number_encrypted, c_1.tax_number_masked, c_1.returned_payments_count, c_1.birth_date, c_1.gender, c_1.dl_number_encrypted, c_1.dl_state_code, c_1.dl_province, c_1.identification_value, c_1.identification_expiration, c_1.notes, c_1.dont_allow_login, c_1.imported_on, c_1.exported_by, c_1.exported_on, c_1.updated_by, c_1.updated_on, c_1.created_on, c_1.created_by, c_1.is_organization, c_1.alt_name_first, c_1.alt_name_middle, c_1.alt_name_last, c_1.preferred_name, c_1.preferred_locale_code, c_1.name_last_matronymic, c_1.tax_id_type_id, c_1.name_full, c_1.details, c_1.tax_number_blind_index
  • Index Cond: ((c_1.cid = 235) AND (c_1.id = o.customer_id))
  • Buffers: shared hit=11,489
59. 28.754 28.888 ↓ 4.5 9 28,888

Materialize (cost=1.14..1,500.72 rows=2 width=60) (actual time=0.000..0.001 rows=9 loops=28,888)

  • Output: mr.cid, mr.property_id, mr.unit_space_id, mrd.scheduled_start_datetime, mrd.scheduled_end_datetime, (to_jsonb(ROW(mr.id, (mrd.scheduled_start_datetime)::date, (mrd.scheduled_end_datetime)::date)))
  • Buffers: shared hit=78
60. 0.026 0.134 ↓ 4.5 9 1

Nested Loop (cost=1.14..1,500.71 rows=2 width=60) (actual time=0.048..0.134 rows=9 loops=1)

  • Output: mr.cid, mr.property_id, mr.unit_space_id, mrd.scheduled_start_datetime, mrd.scheduled_end_datetime, to_jsonb(ROW(mr.id, (mrd.scheduled_start_datetime)::date, (mrd.scheduled_end_datetime)::date))
  • Buffers: shared hit=78
61. 0.009 0.063 ↓ 4.5 9 1

Nested Loop Left Join (cost=0.71..1,483.80 rows=2 width=16) (actual time=0.032..0.063 rows=9 loops=1)

  • Output: mr.id, mr.cid, mr.property_id, mr.unit_space_id
  • Inner Unique: true
  • Filter: ((COALESCE(ms.maintenance_status_type_id, 0) <> 2) AND (COALESCE(ms.maintenance_status_type_id, 0) <> 4))
  • Buffers: shared hit=42
62. 0.036 0.036 ↓ 4.5 9 1

Index Scan using idx_maintenance_requests_property_id on public.maintenance_requests mr (cost=0.43..1,467.17 rows=2 width=20) (actual time=0.020..0.036 rows=9 loops=1)

  • Output: mr.id, mr.cid, mr.parent_maintenance_request_id, mr.property_id, mr.property_building_id, mr.property_unit_id, mr.unit_space_id, mr.customer_id, mr.lease_id, mr.job_project_id, mr.maintenance_priority_id, mr.maintenance_status_id, mr.maintenance_location_id, mr.property_unit_maintenance_location_id, mr.maintenance_problem_id, mr.sub_maintenance_problem_id, mr.recurring_maintenance_request_id, mr.company_employee_id, mr.ap_payee_id, mr.ps_product_id, mr.maintenance_template_id, mr.maintenance_request_type_id, mr.asset_id, mr.add_on_id, mr.maintenance_group_id, mr.remote_primary_key, mr.due_date, mr.is_resident_visible, mr.imported_on, mr.exported_on, mr.printed_on, mr.deleted_by, mr.deleted_on, mr.updated_by, mr.updated_on, mr.created_by, mr.created_on, mr.updated_ps_product_id
  • Index Cond: (mr.property_id = 719,642)
  • Filter: ((mr.cid IS NOT NULL) AND (mr.parent_maintenance_request_id IS NULL) AND (mr.deleted_on IS NULL) AND (mr.cid = 235) AND (mr.maintenance_request_type_id = 1))
  • Rows Removed by Filter: 5
  • Buffers: shared hit=15
63. 0.018 0.018 ↑ 1.0 1 9

Index Scan using pk_maintenance_statuses on public.maintenance_statuses ms (cost=0.28..8.30 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=9)

  • Output: ms.id, ms.cid, ms.integration_database_id, ms.maintenance_status_type_id, ms.remote_primary_key, ms.code, ms.name, ms.description, ms.is_default, ms.is_published, ms.order_num, ms.is_hidden_on_dashboard, ms.imported_on, ms.updated_by, ms.updated_on, ms.created_by, ms.created_on, ms.details
  • Index Cond: ((ms.cid = mr.cid) AND (ms.cid = 235) AND (ms.id = mr.maintenance_status_id))
  • Buffers: shared hit=27
64. 0.045 0.045 ↑ 1.0 1 9

Index Scan using idx_maintenance_request_details_maintenance_request_id on public.maintenance_request_details mrd (cost=0.43..8.45 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=9)

  • Output: mrd.id, mrd.cid, mrd.maintenance_request_id, mrd.main_phone_number_type_id, mrd.alt_phone_number_type_id, mrd.main_message_operator_id, mrd.alt_message_operator_id, mrd.problem_description, mrd.additional_info, mrd.location_specifics, mrd.permission_to_enter, mrd.requested_datetime, mrd.scheduled_start_datetime, mrd.scheduled_end_datetime, mrd.actual_start_datetime, mrd.completed_datetime, mrd.ignore_response_times, mrd.ignore_response_reason, mrd.estimated_hours, mrd.actual_hours, mrd.cost_per_hour, mrd.parts_description, mrd.parts_cost, mrd.equipment_description, mrd.equipment_cost, mrd.additional_cost, mrd.customer_name_first, mrd.customer_name_first_encrypted, mrd.customer_name_last, mrd.customer_name_last_encrypted, mrd.unit_number, mrd.main_phone_number, mrd.main_phone_number_encrypted, mrd.alt_phone_number, mrd.alt_phone_number_encrypted, mrd.email_address, mrd.required_response_datetime, mrd.response_duration, mrd.sms_confirmed_on, mrd.is_billable, mrd.is_pet, mrd.updated_by, mrd.updated_on, mrd.created_by, mrd.created_on, mrd.details, mrd.maintenance_exception_id, mrd.is_requested_am, mrd.requested_date
  • Index Cond: (mrd.maintenance_request_id = mr.id)
  • Buffers: shared hit=36
65. 284.240 288.880 ↓ 24.5 147 28,888

Materialize (cost=2.95..164.35 rows=6 width=72) (actual time=0.000..0.010 rows=147 loops=28,888)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.unit_space_id, cl.property_id, li.lease_start_date, li.lease_end_date, lt.lease_term_type_id, lsw.start_date, lsw.end_date, (to_jsonb(ROW(cl.id, li.id, li.lease_term_id, li.lease_start_window_id, cl.lease_status_type_id, ca.application_stage_id, ca.application_status_id, lus.id, ocus.id, cl.move_in_date, cl.name_first, cl.name_last, c.gender, c.id, lt.lease_term_type_id, lsw.start_date, lsw.end_date, cl.lease_start_date, cl.lease_end_date)))
  • Buffers: shared hit=3,660
66. 1.056 4.640 ↓ 24.5 147 1

Nested Loop Left Join (cost=2.95..164.32 rows=6 width=72) (actual time=0.135..4.640 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.unit_space_id, cl.property_id, li.lease_start_date, li.lease_end_date, lt.lease_term_type_id, lsw.start_date, lsw.end_date, to_jsonb(ROW(cl.id, li.id, li.lease_term_id, li.lease_start_window_id, cl.lease_status_type_id, ca.application_stage_id, ca.application_status_id, lus.id, ocus.id, cl.move_in_date, cl.name_first, cl.name_last, c.gender, c.id, lt.lease_term_type_id, lsw.start_date, lsw.end_date, cl.lease_start_date, cl.lease_end_date))
  • Buffers: shared hit=3,660
67. 0.166 3.290 ↓ 24.5 147 1

Nested Loop Left Join (cost=2.67..114.40 rows=6 width=100) (actual time=0.110..3.290 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.id, cl.unit_space_id, cl.property_id, cl.lease_status_type_id, cl.move_in_date, cl.name_first, cl.name_last, li.id, li.lease_term_id, li.lease_start_window_id, li.lease_start_date, li.lease_end_date, ca.application_stage_id, ca.application_status_id, lt.lease_term_type_id, lsw.start_date, lsw.end_date, lsw.organization_contract_id, lus.id, c.id, c.gender
  • Inner Unique: true
  • Join Filter: ((lt.cid = lsw.cid) AND (lsw.property_id = cl.property_id) AND (lt.id = lsw.lease_term_id))
  • Rows Removed by Join Filter: 1
  • Buffers: shared hit=3,328
68. 0.072 2.977 ↓ 24.5 147 1

Nested Loop (cost=2.38..112.34 rows=6 width=96) (actual time=0.098..2.977 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.id, cl.unit_space_id, cl.property_id, cl.lease_status_type_id, cl.move_in_date, cl.name_first, cl.name_last, li.id, li.lease_term_id, li.lease_start_window_id, li.lease_start_date, li.lease_end_date, ca.application_stage_id, ca.application_status_id, lt.lease_term_type_id, lt.id, lt.cid, lus.id, c.id, c.gender
  • Inner Unique: true
  • Buffers: shared hit=2,992
69. 0.066 2.611 ↓ 147.0 147 1

Nested Loop Left Join (cost=2.10..112.01 rows=1 width=88) (actual time=0.081..2.611 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.id, cl.unit_space_id, cl.property_id, cl.lease_status_type_id, cl.move_in_date, cl.name_first, cl.name_last, li.cid, li.id, li.lease_term_id, li.lease_start_window_id, li.lease_start_date, li.lease_end_date, ca.application_stage_id, ca.application_status_id, lus.id, c.id, c.gender
  • Inner Unique: true
  • Buffers: shared hit=2,551
70. 0.070 2.104 ↓ 147.0 147 1

Nested Loop Left Join (cost=1.68..103.56 rows=1 width=86) (actual time=0.070..2.104 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.id, cl.unit_space_id, cl.property_id, cl.primary_customer_id, cl.lease_status_type_id, cl.move_in_date, cl.name_first, cl.name_last, li.cid, li.id, li.lease_term_id, li.lease_start_window_id, li.lease_start_date, li.lease_end_date, ca.application_stage_id, ca.application_status_id, lus.id
  • Buffers: shared hit=1,963
71. 0.163 1.593 ↓ 147.0 147 1

Nested Loop (cost=1.26..95.11 rows=1 width=82) (actual time=0.054..1.593 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.id, cl.unit_space_id, cl.property_id, cl.primary_customer_id, cl.lease_status_type_id, cl.move_in_date, cl.name_first, cl.name_last, li.cid, li.id, li.lease_term_id, li.lease_start_window_id, li.lease_start_date, li.lease_end_date, ca.application_stage_id, ca.application_status_id
  • Inner Unique: true
  • Join Filter: ((cl.id = li.lease_id) AND (cl.active_lease_interval_id = li.id))
  • Buffers: shared hit=1,375
72. 0.040 0.989 ↓ 147.0 147 1

Nested Loop (cost=0.84..94.39 rows=1 width=70) (actual time=0.039..0.989 rows=147 loops=1)

  • Output: cl.lease_start_date, cl.lease_end_date, cl.cid, cl.id, cl.active_lease_interval_id, cl.unit_space_id, cl.property_id, cl.primary_customer_id, cl.lease_status_type_id, cl.move_in_date, cl.name_first, cl.name_last, ca.lease_id, ca.lease_interval_id, ca.application_stage_id, ca.application_status_id
  • Buffers: shared hit=787
73. 0.325 0.325 ↓ 31.2 156 1

Index Scan using idx_cached_leases_cid_property_id on public.cached_leases cl (cost=0.42..52.11 rows=5 width=54) (actual time=0.023..0.325 rows=156 loops=1)

  • Output: cl.id, cl.cid, cl.property_id, cl.reimbursing_property_id, cl.owner_id, cl.property_unit_id, cl.unit_space_id, cl.occupancy_type_id, cl.payment_allowance_type_id, cl.primary_customer_id, cl.transfer_lease_id, cl.lease_status_type_id, cl.lease_interval_type_id, cl.termination_list_type_id, cl.active_lease_interval_id, cl.m2m_lease_interval_id, cl.integration_database_id, cl.last_delinquency_note_event_id, cl.subsidy_contract_id, cl.subsidy_contract_type_id, cl.set_aside_id, cl.remote_primary_key, cl.lease_status_type, cl.lease_interval_type, cl.company_name, cl.name_first, cl.name_middle, cl.name_last, cl.primary_phone_number, cl.lease_start_date, cl.lease_end_date, cl.move_in_date, cl.notice_date, cl.move_out_date, cl.collections_start_date, cl.property_name, cl.building_name, cl.unit_number_cache, cl.display_number, cl.resident_balance, cl.financial_balance, cl.total_balance, cl.repayment_balance, cl.deposit_held, cl.move_in_review_completed_on, cl.move_out_review_completed_on, cl.transferred_on, cl.fmo_started_on, cl.fmo_approved_on, cl.fmo_processed_on, cl.renewal_prompt_muted_on, cl.renewal_prompt_muted_until, cl.has_repayment_agreement, cl.is_month_to_month, cl.is_transferring_in, cl.is_multi_slot, cl.updated_by, cl.updated_on, cl.created_by, cl.created_on, cl.lease_sub_status, cl.organization_contract_id, cl.scheduled_move_in_start_time, cl.scheduled_move_in_end_time, cl.name_full, cl.move_in_balance, cl.transfer_from_lease_id, cl.selected_deposit_alternative
  • Index Cond: ((cl.cid = 235) AND (cl.property_id = 719,642))
  • Filter: (cl.lease_status_type_id = ANY ('{3,4,5}'::integer[]))
  • Rows Removed by Filter: 44
  • Buffers: shared hit=166
74. 0.624 0.624 ↑ 1.0 1 156

Index Scan using idx_cached_applications_lease_interval_id on public.cached_applications ca (cost=0.42..8.45 rows=1 width=24) (actual time=0.003..0.004 rows=1 loops=156)

  • Output: ca.id, ca.cid, ca.property_id, ca.lease_id, ca.lease_interval_id, ca.lease_interval_type_id, ca.lease_status_type_id, ca.lease_type_id, ca.lead_conversion_type, ca.application_stage_id, ca.application_status_id, ca.application_step_id, ca.max_application_stage_id, ca.max_application_status_id, ca.max_application_step_id, ca.cancellation_list_type_id, ca.cancellation_list_item_id, ca.primary_applicant_id, ca.unit_kind_id, ca.unit_type_id, ca.property_floorplan_id, ca.property_building_id, ca.property_floor_id, ca.property_unit_id, ca.unit_space_id, ca.space_configuration_id, ca.desired_space_configuration_id, ca.screening_id, ca.ps_product_id, ca.application_ps_product_id, ca.lease_ps_product_id, ca.leasing_agent_id, ca.internet_listing_service_id, ca.originating_lead_source_id, ca.converting_lead_source_id, ca.company_application_id, ca.lease_term_id, ca.lease_start_window_id, ca.late_fee_formula_id, ca.combined_application_id, ca.quote_id, ca.sem_ad_group_id, ca.sem_keyword_id, ca.sem_source_id, ca.call_id, ca.website_id, ca.craigslist_post_id, ca.cl_ad_id, ca.traffic_cookie_id, ca.first_event_id, ca.first_event_medium_id, ca.first_leasing_center_event_id, ca.response_event_id, ca.last_event_id, ca.referring_lease_customer_id, ca.lease_signature_type_id, ca.insurance_policy_id, ca.insurance_policy_status_type_id, ca.occupancy_type_id, ca.wait_list_id, ca.wait_list_application_id, ca.wait_list_point_ids, ca.wait_list_points, ca.wait_list_position, ca.wait_list_rejection_count, ca.guest_remote_primary_key, ca.app_remote_primary_key, ca.property_name, ca.building_name, ca.unit_number_cache, ca.display_number, ca.unit_square_feet, ca.unit_prior_application_id, ca.name_first, ca.name_middle, ca.name_last, ca.primary_phone_number, ca.email_address, ca.term_month, ca.lease_start_date, ca.lease_end_date, ca.optimal_monthly_rent_base, ca.optimal_monthly_rent_total, ca.advertised_monthly_rent_base, ca.advertised_monthly_rent_amenity, ca.advertised_monthly_rent_add_on, ca.advertised_monthly_rent_special, ca.advertised_monthly_rent_total, ca.advertised_monthly_other_base, ca.advertised_monthly_other_amenity, ca.advertised_monthly_other_add_on, ca.advertised_monthly_other_special, ca.advertised_monthly_other_total, ca.advertised_one_time_deposit_base, ca.advertised_one_time_deposit_amenity, ca.advertised_one_time_deposit_add_on, ca.advertised_one_time_deposit_special, ca.advertised_one_time_deposit_total, ca.advertised_one_time_application_base, ca.advertised_one_time_application_amenity, ca.advertised_one_time_application_add_on, ca.advertised_one_time_application_special, ca.advertised_one_time_application_total, ca.advertised_one_time_other_base, ca.advertised_one_time_other_amenity, ca.advertised_one_time_other_add_on, ca.advertised_one_time_other_special, ca.advertised_one_time_other_total, ca.executed_monthly_rent_base, ca.executed_monthly_rent_amenity, ca.executed_monthly_rent_add_on, ca.executed_monthly_rent_special, ca.executed_monthly_rent_risk_premium, ca.executed_monthly_rent_pet, ca.executed_monthly_rent_total, ca.executed_monthly_other_base, ca.executed_monthly_other_amenity, ca.executed_monthly_other_add_on, ca.executed_monthly_other_special, ca.executed_monthly_other_risk_premium, ca.executed_monthly_other_pet, ca.executed_monthly_other_total, ca.executed_one_time_deposit_base, ca.executed_one_time_deposit_amenity, ca.executed_one_time_deposit_add_on, ca.executed_one_time_deposit_special, ca.executed_one_time_deposit_risk_premium, ca.executed_one_time_deposit_pet, ca.executed_one_time_deposit_total, ca.executed_one_time_application_base, ca.executed_one_time_application_amenity, ca.executed_one_time_application_add_on, ca.executed_one_time_application_special, ca.executed_one_time_application_risk_premium, ca.executed_one_time_application_pet, ca.executed_one_time_application_total, ca.executed_one_time_other_base, ca.executed_one_time_other_amenity, ca.executed_one_time_other_add_on, ca.executed_one_time_other_special, ca.executed_one_time_other_risk_premium, ca.executed_one_time_other_pet, ca.executed_one_time_other_total, ca.executed_optional_monthly_rent_dog, ca.executed_optional_monthly_rent_cat, ca.executed_optional_monthly_rent_other_pet, ca.executed_optional_monthly_rent_garage, ca.executed_optional_monthly_rent_appliances, ca.executed_optional_monthly_rent_furniture, ca.executed_optional_monthly_rent_furnished, ca.executed_optional_monthly_rent_storage, ca.executed_optional_monthly_rent_parking, ca.executed_optional_monthly_rent_meal_plans, ca.executed_optional_monthly_rent_other_add_on, ca.vehicle_count, ca.household_income, ca.desired_rent_min, ca.desired_rent_max, ca.desired_bedrooms, ca.desired_bathrooms, ca.desired_pets, ca.desired_occupants, ca.desired_amenities, ca.total_responsible, ca.total_not_responsible, ca.total_guarantors, ca.total_non_leasing_applicants, ca.total_applicants, ca.guest_card_field_completions, ca.application_datetime, ca.url_referer, ca.details, ca.quotes_count, ca.conversion_probability, ca.first_contacted_on, ca.time_to_first_response, ca.site_visited_on, ca.property_toured_on, ca.unit_toured_on, ca.blue_moon_application_sent_on, ca.info_approved_on, ca.pre_qualification_completed_on, ca.pre_qualification_approved_on, ca.application_started_on, ca.application_completed_on, ca.application_approved_on, ca.screening_approved_on, ca.lease_generated_on, ca.lease_completed_on, ca.lease_approved_on, ca.cancelled_on, ca.transferred_in_on, ca.transferred_out_on, ca.mute_followups_until, ca.quoted_rent_locked_until, ca.hold_unit_until, ca.wait_list_start_on, ca.wait_list_end_on, ca.requires_capture, ca.is_pet_policy_conflicted, ca.is_lease_partially_generated, ca.is_lead, ca.is_deleted, ca.locked_by, ca.locked_on, ca.updated_by, ca.updated_on, ca.created_by, ca.created_on, ca.application_completed_on_initial, ca.application_approved_on_initial, ca.application_reopened_on, ca.lease_interval_type, ca.lease_status_type, ca.lease_term, ca.lease_start_window_start_date, ca.lease_start_window_end_date, ca.contract_base_rent, ca.contract_amenity_rent, ca.contract_pet_rent, ca.contract_add_on_rent, ca.contract_risk_premium_rent, ca.contract_special_rent, ca.contract_total_rent, ca.contract_base_deposit, ca.contract_amenity_deposit, ca.contract_pet_deposit, ca.contract_add_on_deposit, ca.contract_risk_premium_deposit, ca.contract_special_deposit, ca.contract_base_other, ca.contract_amenity_other, ca.contract_pet_other, ca.contract_add_on_other, ca.contract_risk_premium_other, ca.contract_special_other, ca.contract_total_other, ca.contract_total_deposit, ca.application_partially_completed_on, ca.lease_completed_on_initial, ca.lease_partially_completed_on_initial, ca.lease_approved_on_initial, ca.unit_space_rented_on
  • Index Cond: (ca.lease_interval_id = cl.active_lease_interval_id)
  • Filter: ((ca.cid = 235) AND (cl.id = ca.lease_id) AND (cl.unit_space_id = ca.unit_space_id))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=621
75. 0.441 0.441 ↑ 1.0 1 147

Index Scan using idx_lease_intervals on public.lease_intervals li (cost=0.42..0.71 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=147)

  • Output: li.id, li.cid, li.property_id, li.lease_id, li.lease_interval_type_id, li.lease_status_type_id, li.lease_term_id, li.lease_start_window_id, li.parent_lease_interval_id, li.late_fee_formula_id, li.installment_plan_id, li.remote_primary_key, li.interval_datetime, li.lease_start_date, li.lease_end_date, li.is_import_consolidated, li.is_immediate_move_in, li.updated_by, li.updated_on, li.created_by, li.created_on
  • Index Cond: (li.id = ca.lease_interval_id)
  • Filter: ((li.cid = 235) AND (ca.lease_id = li.lease_id))
  • Buffers: shared hit=588
76. 0.441 0.441 ↑ 1.0 1 147

Index Scan using idx_lease_unit_spaces_lease_id on public.lease_unit_spaces lus (cost=0.42..8.44 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=147)

  • Output: lus.id, lus.cid, lus.property_id, lus.lease_id, lus.unit_space_id, lus.move_in_date, lus.move_out_date, lus.starts_with_lease, lus.ends_with_lease, lus.slot_number, lus.deleted_by, lus.deleted_on, lus.created_by, lus.created_on
  • Index Cond: (lus.lease_id = cl.id)
  • Filter: ((lus.cid = 235) AND (cl.cid = lus.cid) AND (lus.unit_space_id = cl.unit_space_id))
  • Buffers: shared hit=588
77. 0.441 0.441 ↑ 1.0 1 147

Index Scan using pk_customers on public.customers c (cost=0.42..8.44 rows=1 width=10) (actual time=0.003..0.003 rows=1 loops=147)

  • Output: c.id, c.cid, c.integration_database_id, c.lead_source_id, c.leasing_agent_id, c.message_operator_id, c.payment_allowance_type_id, c.marital_status_type_id, c.company_identification_type_id, c.primary_phone_number_type_id, c.secondary_phone_number_type_id, c.remote_primary_key, c.secondary_number, c.company_name, c.name_prefix, c.name_first, c.name_middle, c.name_last, c.name_suffix, c.name_maiden, c.name_spouse, c.primary_street_line1, c.primary_street_line2, c.primary_street_line3, c.primary_city, c.primary_state_code, c.primary_postal_code, c.primary_country_code, c.primary_is_verified, c.phone_number, c.mobile_number, c.work_number, c.fax_number, c.email_address, c.tax_number_encrypted, c.tax_number_masked, c.returned_payments_count, c.birth_date, c.gender, c.dl_number_encrypted, c.dl_state_code, c.dl_province, c.identification_value, c.identification_expiration, c.notes, c.dont_allow_login, c.imported_on, c.exported_by, c.exported_on, c.updated_by, c.updated_on, c.created_on, c.created_by, c.is_organization, c.alt_name_first, c.alt_name_middle, c.alt_name_last, c.preferred_name, c.preferred_locale_code, c.name_last_matronymic, c.tax_id_type_id, c.name_full, c.details, c.tax_number_blind_index
  • Index Cond: ((c.cid = cl.cid) AND (c.cid = 235) AND (c.id = cl.primary_customer_id))
  • Buffers: shared hit=588
78. 0.294 0.294 ↑ 1.0 1 147

Index Scan using pk_lease_terms on public.lease_terms lt (cost=0.29..0.34 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=147)

  • Output: lt.id, lt.cid, lt.lease_term_structure_id, lt.default_lease_term_id, lt.mapping_plt_id, lt.name, lt.term_month, lt.allow_prospect_edit, lt.allow_renewal_edit, lt.is_prospect, lt.is_renewal, lt.is_system, lt.is_disabled, lt.is_default, lt.is_unset, lt.show_on_website, lt.is_commercial, lt.deleted_by, lt.deleted_on, lt.updated_by, lt.updated_on, lt.created_by, lt.created_on, lt.details, lt.occupancy_type_id, lt.lease_term_type_id
  • Index Cond: ((lt.cid = 235) AND (lt.id = li.lease_term_id))
  • Buffers: shared hit=441
79. 0.147 0.147 ↑ 1.0 1 147

Index Scan using pk_lease_start_windows on public.lease_start_windows lsw (cost=0.29..0.33 rows=1 width=28) (actual time=0.001..0.001 rows=1 loops=147)

  • Output: lsw.id, lsw.cid, lsw.lease_start_structure_id, lsw.default_lease_start_window_id, lsw.property_id, lsw.lease_term_id, lsw.offset_start_days, lsw.offset_end_days, lsw.start_date, lsw.end_date, lsw.billing_end_date, lsw.renewal_start_date, lsw.renewal_billing_start_date, lsw.is_active, lsw.is_default, lsw.deleted_by, lsw.deleted_on, lsw.updated_by, lsw.updated_on, lsw.created_by, lsw.created_on, lsw.organization_contract_id, lsw.lease_extension_date, lsw.occupancy_type_id, lsw.min_days, lsw.max_days, lsw.lease_term_type_id, lsw.show_on_website
  • Index Cond: ((lsw.cid = 235) AND (lsw.id = li.lease_start_window_id))
  • Filter: ((lsw.deleted_on IS NULL) AND (lsw.is_active IS TRUE) AND (lsw.property_id = 719,642))
  • Buffers: shared hit=336
80. 0.294 0.294 ↑ 1.0 1 147

Index Scan using ca_organization_contract_unit_spaces_idx on public.organization_contract_unit_spaces ocus (cost=0.28..8.31 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=147)

  • Output: ocus.id, ocus.cid, ocus.organization_contract_id, ocus.unit_space_id, ocus.deleted_by, ocus.deleted_on, ocus.updated_by, ocus.updated_on, ocus.created_by, ocus.created_on, ocus.property_id
  • Index Cond: ((ocus.cid = cl.cid) AND (ocus.cid = 235) AND (ocus.organization_contract_id = lsw.organization_contract_id) AND (ocus.unit_space_id = cl.unit_space_id))
  • Buffers: shared hit=332
81. 0.005 314.036 ↓ 2.0 2 1

Hash (cost=153,307.54..153,307.54 rows=1 width=52) (actual time=314.036..314.036 rows=2 loops=1)

  • Output: st.cid, st.property_id, st.unit_space_id, st.scheduled_start_date, st.scheduled_end_date, (to_jsonb(ROW(st.unit_exclusion_reason_type_id, st.scheduled_start_date, st.scheduled_end_date)))
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=89,913
82. 0.018 314.031 ↓ 2.0 2 1

Subquery Scan on st (cost=153,307.46..153,307.54 rows=1 width=52) (actual time=314.016..314.031 rows=2 loops=1)

  • Output: st.cid, st.property_id, st.unit_space_id, st.scheduled_start_date, st.scheduled_end_date, to_jsonb(ROW(st.unit_exclusion_reason_type_id, st.scheduled_start_date, st.scheduled_end_date))
  • Filter: ((st.scheduled_start_date <= '2020-10-29'::date) AND (st.scheduled_end_date >= '2020-07-30'::date))
  • Rows Removed by Filter: 10
  • Buffers: shared hit=89,913
83. 0.048 314.013 ↓ 12.0 12 1

WindowAgg (cost=153,307.46..153,307.52 rows=1 width=64) (actual time=313.994..314.013 rows=12 loops=1)

  • Output: st_1.cid, st_1.property_id, (((st_1.details ->> 'unit_space_id'::text)))::integer, CASE WHEN ((st_1.details ->> 'prior_scheduled_task_id'::text) IS NULL) THEN (st_1.title)::integer WHEN ((st_1.details ->> 'prior_scheduled_task_id'::text) IS NOT NULL) THEN 1 ELSE NULL::integer END, (st_1.start_on)::date, COALESCE((((lead(st_1.start_on, 1) OVER (?))::date - '1 day'::interval))::date, '2099-12-31'::date), st_1.start_on, ((st_1.details ->> 'unit_space_id'::text))
  • Buffers: shared hit=89,913
84. 0.072 313.965 ↓ 12.0 12 1

Sort (cost=153,307.46..153,307.47 rows=1 width=622) (actual time=313.964..313.965 rows=12 loops=1)

  • Output: st_1.cid, st_1.property_id, st_1.start_on, ((st_1.details ->> 'unit_space_id'::text)), st_1.details, st_1.title
  • Sort Key: ((st_1.details ->> 'unit_space_id'::text)), st_1.start_on
  • Sort Method: quicksort Memory: 26kB
  • Buffers: shared hit=89,913
85. 279.363 313.893 ↓ 12.0 12 1

Bitmap Heap Scan on public.scheduled_tasks st_1 (cost=7,074.72..153,307.45 rows=1 width=622) (actual time=53.284..313.893 rows=12 loops=1)

  • Output: st_1.cid, st_1.property_id, st_1.start_on, (st_1.details ->> 'unit_space_id'::text), st_1.details, st_1.title
  • Recheck Cond: (st_1.cid = 235)
  • Filter: ((st_1.deleted_by IS NULL) AND (st_1.deleted_on IS NULL) AND (st_1.property_id = ANY ('{719642}'::integer[])) AND (st_1.scheduled_task_type_id = 11) AND (st_1.property_id = 719,642))
  • Rows Removed by Filter: 356,262
  • Heap Blocks: exact=88,485
  • Buffers: shared hit=89,907
86. 34.530 34.530 ↓ 1.0 357,696 1

Bitmap Index Scan on pk_scheduled_tasks (cost=0.00..7,074.72 rows=352,839 width=0) (actual time=34.530..34.530 rows=357,696 loops=1)

  • Index Cond: (st_1.cid = 235)
  • Buffers: shared hit=1,108
Planning time : 26.681 ms
Execution time : 28,312.596 ms