explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EKvw

Settings
# exclusive inclusive rows x rows loops node
1. 377.039 93,143.971 ↓ 19.1 19,110 1

Hash Left Join (cost=112,622.62..254,951.54 rows=1,000 width=99) (actual time=779.066..93,143.971 rows=19,110 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, est.unit_exclusion_reason_type_id, est.is_marketed, COALESCE(us.occupancy_type_id, 1), pu.gender_id, (CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 2) THEN a.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN ((ra.ar_origin_id = 3) AND (ra.ar_cascade_id = 4)) THEN ra.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 6) THEN s.id ELSE NULL::integer END) > 0) THEN true ELSE false END), CASE WHEN (laus.available_on <= (generate_series.generate_series)::date) 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', (to_jsonb(array_agg(s.id))), 'amenities', (to_jsonb(array_agg(CASE WHEN (ra.ar_cascade_id = 4) THEN a.id ELSE NULL::integer END))), '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_type_id', est.unit_exclusion_reason_type_id), 1, now(), false
  • Hash Cond: ((us.cid = est.cid) AND (us.property_id = est.property_id) AND (us.id = est.unit_space_id))
  • Join Filter: (((generate_series.generate_series)::date >= est.start_date) AND ((generate_series.generate_series)::date <= (est.end_date)::date))
2.          

CTE exclusion_scheduled_task

3. 0.003 668.038 ↓ 0.0 0 1

Nested Loop Left Join (cost=112,203.12..112,205.21 rows=1 width=64) (actual time=668.038..668.038 rows=0 loops=1)

  • Output: st.cid, st.property_id, st.unit_space_id, st.unit_exclusion_reason_type_id, st.start_date, st.end_date, st.prior_scheduled_task_id, use.is_marketed
  • Inner Unique: true
4. 0.002 668.035 ↓ 0.0 0 1

Subquery Scan on st (cost=112,202.84..112,202.91 rows=1 width=60) (actual time=668.035..668.035 rows=0 loops=1)

  • Output: st.cid, st.property_id, st.unit_space_id, st.unit_exclusion_reason_type_id, st.start_date, st.end_date, st.prior_scheduled_task_id, ((scheduled_tasks.details ->> 'unit_space_id'::text)), scheduled_tasks.start_on
  • Filter: ((st.end_date IS NOT NULL) AND (st.prior_scheduled_task_id IS NULL))
5. 0.007 668.033 ↓ 0.0 0 1

WindowAgg (cost=112,202.84..112,202.90 rows=1 width=100) (actual time=668.033..668.033 rows=0 loops=1)

  • Output: scheduled_tasks.cid, scheduled_tasks.property_id, (((scheduled_tasks.details ->> 'unit_space_id'::text)))::integer, (scheduled_tasks.title)::integer, (scheduled_tasks.start_on)::date, ((lead(scheduled_tasks.start_on, 1) OVER (?))::date - '1 day'::interval), (scheduled_tasks.details ->> 'prior_scheduled_task_id'::text), ((scheduled_tasks.details ->> 'unit_space_id'::text)), scheduled_tasks.start_on
6. 0.062 668.026 ↓ 0.0 0 1

Sort (cost=112,202.84..112,202.85 rows=1 width=675) (actual time=668.026..668.026 rows=0 loops=1)

  • Output: scheduled_tasks.cid, scheduled_tasks.property_id, ((scheduled_tasks.details ->> 'unit_space_id'::text)), scheduled_tasks.start_on, scheduled_tasks.details, scheduled_tasks.title
  • Sort Key: ((scheduled_tasks.details ->> 'unit_space_id'::text)), scheduled_tasks.start_on
  • Sort Method: quicksort Memory: 25kB
7. 667.964 667.964 ↓ 0.0 0 1

Index Scan using pk_scheduled_tasks on public.scheduled_tasks (cost=0.42..112,202.83 rows=1 width=675) (actual time=667.964..667.964 rows=0 loops=1)

  • Output: scheduled_tasks.cid, scheduled_tasks.property_id, (scheduled_tasks.details ->> 'unit_space_id'::text), scheduled_tasks.start_on, scheduled_tasks.details, scheduled_tasks.title
  • Index Cond: (scheduled_tasks.cid = 235)
  • Filter: ((scheduled_tasks.property_id = 719,642) AND (scheduled_tasks.schedule_type_id = 11))
  • Rows Removed by Filter: 317,823
8. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_unit_space_exclusions_cid_property_id_unit_exclusion_reason_ on public.unit_space_exclusions use (cost=0.28..2.30 rows=1 width=16) (never executed)

  • Output: use.id, use.cid, use.property_id, use.unit_exclusion_reason_type_id, use.gl_account_id, use.is_marketed, use.is_reportable, use.custom_name, use.is_considered_occupied, use.updated_by, use.updated_on, use.created_by, use.created_on, use.details
  • Index Cond: ((st.cid = use.cid) AND (st.property_id = use.property_id) AND (st.unit_exclusion_reason_type_id = use.unit_exclusion_reason_type_id))
9. 456.191 92,098.887 ↓ 19.1 19,110 1

Nested Loop Left Join (cost=417.37..142,682.52 rows=1,000 width=308) (actual time=110.929..92,098.887 rows=19,110 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, 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(CASE WHEN (ra.ar_origin_id = 2) THEN a.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN ((ra.ar_origin_id = 3) AND (ra.ar_cascade_id = 4)) THEN ra.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 6) THEN s.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (to_jsonb(array_agg(s.id))), (to_jsonb(array_agg(CASE WHEN (ra.ar_cascade_id = 4) THEN a.id ELSE NULL::integer 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: 2,394,029
10. 35.789 91,433.487 ↓ 19.0 19,019 1

Nested Loop Left Join (cost=250.87..142,191.29 rows=1,000 width=256) (actual time=100.085..91,433.487 rows=19,019 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, 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(CASE WHEN (ra.ar_origin_id = 2) THEN a.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN ((ra.ar_origin_id = 3) AND (ra.ar_cascade_id = 4)) THEN ra.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 6) THEN s.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (to_jsonb(array_agg(s.id))), (to_jsonb(array_agg(CASE WHEN (ra.ar_cascade_id = 4) THEN a.id ELSE NULL::integer 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: 133,133
11. 5,277.995 91,378.679 ↓ 19.0 19,019 1

Nested Loop Left Join (cost=249.74..141,733.64 rows=1,000 width=224) (actual time=99.681..91,378.679 rows=19,019 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, 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(CASE WHEN (ra.ar_origin_id = 2) THEN a.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN ((ra.ar_origin_id = 3) AND (ra.ar_cascade_id = 4)) THEN ra.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 6) THEN s.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (to_jsonb(array_agg(s.id))), (to_jsonb(array_agg(CASE WHEN (ra.ar_cascade_id = 4) THEN a.id ELSE NULL::integer 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: 39,616,213
12. 54.108 83,647.233 ↓ 19.0 19,019 1

Nested Loop Left Join (cost=142.87..141,468.52 rows=1,000 width=192) (actual time=66.587..83,647.233 rows=19,019 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, 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(CASE WHEN (ra.ar_origin_id = 2) THEN a.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN ((ra.ar_origin_id = 3) AND (ra.ar_cascade_id = 4)) THEN ra.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 6) THEN s.id ELSE NULL::integer END) > 0) THEN true ELSE false END), (to_jsonb(array_agg(s.id))), (to_jsonb(array_agg(CASE WHEN (ra.ar_cascade_id = 4) THEN a.id ELSE NULL::integer END)))
13. 40.929 4,683.294 ↓ 19.0 19,019 1

Nested Loop Left Join (cost=14.00..12,559.46 rows=1,000 width=137) (actual time=60.836..4,683.294 rows=19,019 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, pu.gender_id, pf.cid, pf.property_id, pf.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)))
14. 41.742 134.862 ↓ 19.0 19,019 1

Hash Left Join (cost=1.77..291.46 rows=1,000 width=73) (actual time=60.256..134.862 rows=19,019 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, pu.gender_id, pf.cid, pf.property_id, pf.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))
15. 12.412 33.077 ↓ 19.0 19,019 1

Nested Loop (cost=0.87..278.06 rows=1,000 width=61) (actual time=0.175..33.077 rows=19,019 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, pu.gender_id, pf.cid, pf.property_id, pf.id, generate_series.generate_series
16. 1.146 10.842 ↓ 209.0 209 1

Nested Loop (cost=0.87..258.05 rows=1 width=53) (actual time=0.126..10.842 rows=209 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, pu.gender_id, pf.cid, pf.property_id, pf.id
  • Inner Unique: true
17. 1.265 7.606 ↓ 209.0 209 1

Nested Loop (cost=0.58..256.60 rows=1 width=41) (actual time=0.095..7.606 rows=209 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, pu.gender_id
  • Inner Unique: true
18. 2.579 2.579 ↓ 3.2 209 1

Index Scan using idx_unit_spaces_company_property_id on public.unit_spaces us (cost=0.29..112.78 rows=66 width=37) (actual time=0.048..2.579 rows=209 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
  • Index 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: 47
19. 3.762 3.762 ↑ 1.0 1 209

Index Scan using pk_property_units on public.property_units pu (cost=0.29..2.18 rows=1 width=16) (actual time=0.018..0.018 rows=1 loops=209)

  • 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)
20. 2.090 2.090 ↑ 1.0 1 209

Index Scan using pk_property_floorplans on public.property_floorplans pf (cost=0.28..1.45 rows=1 width=12) (actual time=0.010..0.010 rows=1 loops=209)

  • Output: pf.id, pf.cid, pf.property_id, pf.unit_kind_id, pf.remote_primary_key, pf.vaultware_number, pf.floorplan_name, pf.description, pf.min_rent, pf.max_rent, pf.min_deposit, pf.max_deposit, pf.min_square_feet, pf.max_square_feet, pf.number_of_units, pf.number_of_available_units, pf.number_of_floors, pf.number_of_rooms, pf.number_of_bedrooms, pf.bedroom_description, pf.number_of_bathrooms, pf.bathroom_description, pf.notes, pf.block_pricing_integration, pf.is_disabled_virtual_move_in, pf.has_space_configuration_terms, pf.is_manual_rent_range, pf.is_manual_deposit_range, pf.is_published, pf.is_featured, pf.allows_cats, pf.allows_dogs, pf.order_num, pf.imported_on, pf.deleted_by, pf.deleted_on, pf.updated_by, pf.updated_on, pf.created_by, pf.created_on, pf.details, pf.seo_title, pf.seo_description, pf.seo_keywords
  • Index Cond: ((pf.cid = 235) AND (pf.id = us.property_floorplan_id))
21. 9.823 9.823 ↑ 11.0 91 209

Function Scan on pg_catalog.generate_series (cost=0.01..10.01 rows=1,000 width=8) (actual time=0.001..0.047 rows=91 loops=209)

  • Output: generate_series.generate_series
  • Function Call: generate_series(('2020-02-13'::date)::timestamp with time zone, ('2020-05-13'::date)::timestamp with time zone, '1 day'::interval)
22. 1.810 60.043 ↓ 6,552.0 6,552 1

Hash (cost=0.88..0.88 rows=1 width=24) (actual time=60.043..60.043 rows=6,552 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: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 423kB
23. 58.233 58.233 ↓ 6,552.0 6,552 1

Function Scan on public.load_available_unit_spaces laus (cost=0.25..0.88 rows=1 width=24) (actual time=56.597..58.233 rows=6,552 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-02-13'::date, false, true, true, '2020-05-13'::date, false)
  • Filter: (laus.cid = 235)
24. 513.513 4,507.503 ↑ 1.0 1 19,019

Aggregate (cost=12.23..12.25 rows=1 width=64) (actual time=0.237..0.237 rows=1 loops=19,019)

  • 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))
25. 209.209 3,993.990 ↓ 2.0 12 19,019

Nested Loop Left Join (cost=6.99..12.20 rows=6 width=8) (actual time=0.178..0.210 rows=12 loops=19,019)

  • 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: 50
26. 114.114 646.646 ↓ 1.8 11 19,019

Nested Loop (cost=0.57..4.62 rows=6 width=16) (actual time=0.016..0.034 rows=11 loops=19,019)

  • Output: lt_1.id, lt_1.cid, lt_1.lease_term_type_id, pcs.property_id
27. 152.152 152.152 ↑ 1.0 1 19,019

Index Scan using idx_property_charge_settings_property_id on public.property_charge_settings pcs (cost=0.28..2.30 rows=1 width=12) (actual time=0.007..0.008 rows=1 loops=19,019)

  • 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)
28. 380.380 380.380 ↓ 11.0 11 19,019

Index Scan using idx_lease_terms_master on public.lease_terms lt_1 (cost=0.29..2.30 rows=1 width=16) (actual time=0.006..0.020 rows=11 loops=19,019)

  • 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
29. 228.228 3,138.135 ↓ 5.0 5 209,209

Materialize (cost=6.42..7.45 rows=1 width=16) (actual time=0.010..0.015 rows=5 loops=209,209)

  • Output: lsw_2.id, lsw_2.cid, lsw_2.lease_term_id, lsw_2.property_id
30. 1,255.254 2,909.907 ↓ 5.0 5 19,019

Bitmap Heap Scan on public.lease_start_windows lsw_2 (cost=6.42..7.44 rows=1 width=16) (actual time=0.107..0.153 rows=5 loops=19,019)

  • Output: lsw_2.id, lsw_2.cid, lsw_2.lease_term_id, lsw_2.property_id
  • Recheck Cond: ((lsw_2.property_id = us.property_id) AND (lsw_2.cid = us.cid))
  • Filter: ((lsw_2.deleted_on IS NULL) AND (lsw_2.is_active IS TRUE) AND (lsw_2.end_date >= (generate_series.generate_series)::date))
  • Rows Removed by Filter: 71
  • Heap Blocks: exact=494,494
31. 57.057 1,654.653 ↓ 0.0 0 19,019

BitmapAnd (cost=6.42..6.42 rows=1 width=0) (actual time=0.087..0.087 rows=0 loops=19,019)

32. 190.190 190.190 ↓ 9.5 76 19,019

Bitmap Index Scan on idx_lease_start_windows_property_id (cost=0.00..1.34 rows=8 width=0) (actual time=0.010..0.010 rows=76 loops=19,019)

  • Index Cond: (lsw_2.property_id = us.property_id)
33. 1,407.406 1,407.406 ↓ 3.8 1,298 19,019

Bitmap Index Scan on idx_lease_start_window_cid_structure_dates (cost=0.00..4.83 rows=339 width=0) (actual time=0.074..0.074 rows=1,298 loops=19,019)

  • Index Cond: (lsw_2.cid = us.cid)
34. 304.304 78,909.831 ↑ 1.0 1 19,019

Aggregate (cost=128.87..128.89 rows=1 width=67) (actual time=4.149..4.149 rows=1 loops=19,019)

  • Output: CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 2) THEN a.id ELSE NULL::integer END) > 0) THEN true ELSE false END, CASE WHEN (count(CASE WHEN ((ra.ar_origin_id = 3) AND (ra.ar_cascade_id = 4)) THEN ra.id ELSE NULL::integer END) > 0) THEN true ELSE false END, CASE WHEN (count(CASE WHEN (ra.ar_origin_id = 6) THEN s.id ELSE NULL::integer END) > 0) THEN true ELSE false END, to_jsonb(array_agg(CASE WHEN (ra.ar_cascade_id = 4) THEN a.id ELSE NULL::integer END)), to_jsonb(array_agg(s.id))
35. 64.337 78,605.527 ↓ 4.0 4 19,019

Nested Loop Left Join (cost=106.82..128.84 rows=1 width=20) (actual time=4.052..4.133 rows=4 loops=19,019)

  • Output: ra.ar_origin_id, a.id, ra.ar_cascade_id, ra.id, s.id
  • Inner Unique: true
36. 137.501 78,168.090 ↓ 4.0 4 19,019

Nested Loop Left Join (cost=106.53..126.10 rows=1 width=24) (actual time=4.045..4.110 rows=4 loops=19,019)

  • Output: ra.ar_origin_id, ra.ar_cascade_id, ra.id, ra.cid, ra.ar_origin_reference_id, a.id
  • Inner Unique: true
37. 1,901.900 77,806.729 ↓ 4.0 4 19,019

Bitmap Heap Scan on public.rate_associations ra (cost=106.25..123.78 rows=1 width=20) (actual time=4.035..4.091 rows=4 loops=19,019)

  • 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
  • Recheck Cond: ((ra.property_id = pf.property_id) AND (ra.cid = pf.cid))
  • Filter: ((ra.ar_origin_id = ANY ('{2,3,6}'::integer[])) AND (ra.ar_cascade_reference_id = CASE WHEN (ra.ar_cascade_id = 4) THEN us.id WHEN (ra.ar_cascade_id = 3) THEN us.unit_type_id WHEN (ra.ar_cascade_id = 2) THEN pf.id WHEN (ra.ar_cascade_id = 1) THEN us.property_id ELSE NULL::integer END))
  • Rows Removed by Filter: 227
  • Heap Blocks: exact=551,551
38. 95.095 75,904.829 ↓ 0.0 0 19,019

BitmapAnd (cost=106.25..106.25 rows=17 width=0) (actual time=3.991..3.991 rows=0 loops=19,019)

39. 361.361 361.361 ↑ 1.2 231 19,019

Bitmap Index Scan on idx_rate_associations_property_id (cost=0.00..3.55 rows=284 width=0) (actual time=0.019..0.019 rows=231 loops=19,019)

  • Index Cond: (ra.property_id = pf.property_id)
40. 75,448.373 75,448.373 ↓ 6.6 64,692 19,019

Bitmap Index Scan on pk_rate_associations (cost=0.00..102.45 rows=9,871 width=0) (actual time=3.967..3.967 rows=64,692 loops=19,019)

  • Index Cond: (ra.cid = pf.cid)
41. 223.860 223.860 ↓ 0.0 0 74,620

Index Only Scan using pk_amenities on public.amenities a (cost=0.28..2.30 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=74,620)

  • Output: a.cid, a.id
  • Index Cond: ((a.cid = ra.cid) AND (a.cid = pf.cid) AND (a.id = ra.ar_origin_reference_id))
  • Heap Fetches: 3,458
42. 373.100 373.100 ↑ 1.0 1 74,620

Index Scan using pk_specials on public.specials s (cost=0.28..2.33 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=74,620)

  • 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 = ra.cid) AND (s.cid = pf.cid) AND (s.id = ra.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: 0
43. 2,422.102 2,453.451 ↓ 2,083.0 2,083 19,019

Materialize (cost=106.87..237.62 rows=1 width=48) (actual time=0.001..0.129 rows=2,083 loops=19,019)

  • 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)))
44. 12.050 31.349 ↓ 2,083.0 2,083 1

Nested Loop (cost=106.87..237.62 rows=1 width=48) (actual time=3.369..31.349 rows=2,083 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
45. 2.593 13.050 ↓ 2,083.0 2,083 1

Nested Loop (cost=106.45..235.29 rows=1 width=36) (actual time=3.322..13.050 rows=2,083 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
46. 1.173 6.291 ↓ 2,083.0 2,083 1

Hash Join (cost=106.30..235.11 rows=1 width=28) (actual time=3.280..6.291 rows=2,083 loops=1)

  • Output: oc.cid, oc.id, oc.organization_id, oc.organization_contract_status_type_id, ocus_1.unit_space_id, lsw_1.start_date, lsw_1.end_date
  • Hash Cond: (ocus_1.organization_contract_id = oc.id)
47. 1.896 1.896 ↑ 1.1 2,123 1

Index Scan using pk_organization_contract_unit_spaces on public.organization_contract_unit_spaces ocus_1 (cost=0.28..120.48 rows=2,281 width=12) (actual time=0.039..1.896 rows=2,123 loops=1)

  • 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
  • Index Cond: (ocus_1.cid = 235)
  • Filter: (ocus_1.deleted_on IS NULL)
  • Rows Removed by Filter: 375
48. 0.083 3.222 ↓ 275.0 275 1

Hash (cost=106.01..106.01 rows=1 width=28) (actual time=3.222..3.222 rows=275 loops=1)

  • Output: oc.cid, oc.id, oc.organization_id, oc.organization_contract_status_type_id, lsw_1.organization_contract_id, lsw_1.start_date, lsw_1.end_date
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
49. 0.946 3.139 ↓ 275.0 275 1

Merge Join (cost=25.05..106.01 rows=1 width=28) (actual time=0.317..3.139 rows=275 loops=1)

  • Output: oc.cid, oc.id, oc.organization_id, oc.organization_contract_status_type_id, lsw_1.organization_contract_id, lsw_1.start_date, lsw_1.end_date
  • Inner Unique: true
  • Merge Cond: (lsw_1.property_id = oc.property_id)
  • Join Filter: ((oc.id = lsw_1.organization_contract_id) AND (oc.lease_start_window_id = lsw_1.id))
  • Rows Removed by Join Filter: 5,071
50. 1.593 1.593 ↓ 3.4 534 1

Index Scan using idx_lease_start_windows_property_id on public.lease_start_windows lsw_1 (cost=0.29..588.86 rows=159 width=24) (actual time=0.017..1.593 rows=534 loops=1)

  • 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
  • Filter: ((lsw_1.deleted_on IS NULL) AND (lsw_1.is_active IS TRUE) AND (lsw_1.cid = 235) AND (lsw_1.lease_term_type_id = 2))
  • Rows Removed by Filter: 1,411
51. 0.409 0.600 ↓ 19.9 5,212 1

Sort (cost=24.76..25.42 rows=262 width=24) (actual time=0.265..0.600 rows=5,212 loops=1)

  • Output: oc.cid, oc.id, oc.property_id, oc.lease_start_window_id, oc.organization_id, oc.organization_contract_status_type_id
  • Sort Key: oc.property_id
  • Sort Method: quicksort Memory: 46kB
52. 0.191 0.191 ↓ 1.0 275 1

Seq Scan on public.organization_contracts oc (cost=0.00..14.24 rows=262 width=24) (actual time=0.020..0.191 rows=275 loops=1)

  • Output: oc.cid, oc.id, oc.property_id, oc.lease_start_window_id, oc.organization_id, oc.organization_contract_status_type_id
  • Filter: ((oc.organization_contract_status_type_id = ANY ('{1,2}'::integer[])) AND (oc.cid = 235))
  • Rows Removed by Filter: 154
53. 4.166 4.166 ↑ 1.0 1 2,083

Index Scan using pk_organizations on public.organizations o (cost=0.14..0.18 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=2,083)

  • Output: o.id, o.cid, o.customer_id, o.is_archived, o.updated_by, o.updated_on, o.created_by, o.created_on
  • Index Cond: ((o.cid = 235) AND (o.id = oc.organization_id))
54. 6.249 6.249 ↑ 1.0 1 2,083

Index Scan using idx_customers_id on public.customers c_1 (cost=0.42..2.33 rows=1 width=21) (actual time=0.003..0.003 rows=1 loops=2,083)

  • 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.id = o.customer_id)
  • Filter: (c_1.cid = 235)
55. 18.633 19.019 ↓ 7.0 7 19,019

Materialize (cost=1.13..417.65 rows=1 width=60) (actual time=0.000..0.001 rows=7 loops=19,019)

  • 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)))
56. 0.054 0.386 ↓ 7.0 7 1

Nested Loop (cost=1.13..417.65 rows=1 width=60) (actual time=0.123..0.386 rows=7 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))
57. 0.018 0.178 ↓ 7.0 7 1

Nested Loop Left Join (cost=0.70..415.19 rows=1 width=16) (actual time=0.072..0.178 rows=7 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) <> 3) AND (COALESCE(ms.maintenance_status_type_id, 0) <> 4))
58. 0.125 0.125 ↓ 7.0 7 1

Index Scan using idx_maintenance_requests_property_id on public.maintenance_requests mr (cost=0.43..412.88 rows=1 width=20) (actual time=0.046..0.125 rows=7 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.parent_maintenance_request_id IS NULL) AND (mr.deleted_on IS NULL) AND (mr.cid = mr.cid) AND (mr.cid = 235) AND (mr.maintenance_request_type_id = 1))
  • Rows Removed by Filter: 5
59. 0.035 0.035 ↑ 1.0 1 7

Index Scan using idx_maintenance_statuses_id on public.maintenance_statuses ms (cost=0.27..2.30 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=7)

  • 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: (mr.maintenance_status_id = ms.id)
  • Filter: ((ms.cid = 235) AND (mr.cid = ms.cid))
60. 0.154 0.154 ↑ 1.0 1 7

Index Scan using idx_maintenance_request_details_maintenance_request_id on public.maintenance_request_details mrd (cost=0.43..2.45 rows=1 width=20) (actual time=0.022..0.022 rows=1 loops=7)

  • 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
  • Index Cond: (mrd.maintenance_request_id = mr.id)
61. 198.593 209.209 ↓ 25.2 126 19,019

Materialize (cost=166.50..316.24 rows=5 width=72) (actual time=0.000..0.011 rows=126 loops=19,019)

  • 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)))
62. 2.044 10.616 ↓ 25.2 126 1

Hash Left Join (cost=166.50..316.21 rows=5 width=72) (actual time=1.694..10.616 rows=126 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))
  • Hash Cond: ((cl.cid = ocus.cid) AND (cl.unit_space_id = ocus.unit_space_id) AND (lsw.organization_contract_id = ocus.organization_contract_id))
63. 0.180 7.175 ↓ 25.2 126 1

Nested Loop Left Join (cost=2.67..152.08 rows=5 width=100) (actual time=0.241..7.175 rows=126 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
64. 0.235 6.617 ↓ 25.2 126 1

Nested Loop (cost=2.38..150.44 rows=5 width=96) (actual time=0.229..6.617 rows=126 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
65. 0.221 6.004 ↓ 126.0 126 1

Nested Loop Left Join (cost=2.10..150.13 rows=1 width=88) (actual time=0.198..6.004 rows=126 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
66. 0.192 5.279 ↓ 126.0 126 1

Nested Loop Left Join (cost=1.68..147.68 rows=1 width=86) (actual time=0.176..5.279 rows=126 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
67. 0.197 4.205 ↓ 126.0 126 1

Nested Loop (cost=1.26..145.26 rows=1 width=82) (actual time=0.142..4.205 rows=126 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))
68. 0.227 2.622 ↓ 126.0 126 1

Nested Loop (cost=0.84..144.74 rows=1 width=70) (actual time=0.098..2.622 rows=126 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
69. 0.653 0.653 ↓ 4.5 134 1

Index Scan using idx_cached_leases_property_id_lease_status_type_id on public.cached_leases cl (cost=0.42..71.09 rows=30 width=54) (actual time=0.050..0.653 rows=134 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
  • Index Cond: ((cl.property_id = 719,642) AND (cl.lease_status_type_id = ANY ('{3,4,5}'::integer[])))
  • Filter: (cl.cid = 235)
70. 1.742 1.742 ↑ 1.0 1 134

Index Scan using idx_cached_applications_lease_interval_id on public.cached_applications ca (cost=0.42..2.45 rows=1 width=24) (actual time=0.013..0.013 rows=1 loops=134)

  • 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
71. 1.386 1.386 ↑ 1.0 1 126

Index Scan using idx_lease_intervals on public.lease_intervals li (cost=0.42..0.50 rows=1 width=28) (actual time=0.011..0.011 rows=1 loops=126)

  • 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))
72. 0.882 0.882 ↑ 1.0 1 126

Index Scan using idx_lease_unit_spaces_lease_id on public.lease_unit_spaces lus (cost=0.42..2.41 rows=1 width=16) (actual time=0.006..0.007 rows=1 loops=126)

  • 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: (cl.id = lus.lease_id)
  • Filter: ((lus.cid = 235) AND (cl.cid = lus.cid) AND (lus.unit_space_id = cl.unit_space_id))
73. 0.504 0.504 ↑ 1.0 1 126

Index Scan using idx_customers_id on public.customers c (cost=0.42..2.44 rows=1 width=10) (actual time=0.004..0.004 rows=1 loops=126)

  • 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: (cl.primary_customer_id = c.id)
  • Filter: ((c.cid = 235) AND (cl.cid = c.cid))
74. 0.378 0.378 ↑ 1.0 1 126

Index Scan using pk_lease_terms on public.lease_terms lt (cost=0.29..0.31 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=126)

  • 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))
75. 0.378 0.378 ↑ 1.0 1 126

Index Scan using pk_lease_start_windows on public.lease_start_windows lsw (cost=0.29..0.31 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=126)

  • 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))
76. 0.608 1.397 ↓ 1.0 2,498 1

Hash (cost=120.48..120.48 rows=2,477 width=16) (actual time=1.397..1.397 rows=2,498 loops=1)

  • Output: ocus.cid, ocus.unit_space_id, ocus.organization_contract_id, ocus.id
  • Buckets: 4,096 Batches: 1 Memory Usage: 150kB
77. 0.789 0.789 ↓ 1.0 2,498 1

Index Scan using pk_organization_contract_unit_spaces on public.organization_contract_unit_spaces ocus (cost=0.28..120.48 rows=2,477 width=16) (actual time=0.021..0.789 rows=2,498 loops=1)

  • Output: ocus.cid, ocus.unit_space_id, ocus.organization_contract_id, ocus.id
  • Index Cond: (ocus.cid = 235)
78. 0.004 668.045 ↓ 0.0 0 1

Hash (cost=0.03..0.03 rows=1 width=32) (actual time=668.045..668.045 rows=0 loops=1)

  • Output: est.unit_exclusion_reason_type_id, est.is_marketed, est.cid, est.property_id, est.unit_space_id, est.start_date, est.end_date
  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
79. 668.041 668.041 ↓ 0.0 0 1

CTE Scan on exclusion_scheduled_task est (cost=0.00..0.03 rows=1 width=32) (actual time=668.041..668.041 rows=0 loops=1)

  • Output: est.unit_exclusion_reason_type_id, est.is_marketed, est.cid, est.property_id, est.unit_space_id, est.start_date, est.end_date
  • Filter: ((est.cid = 235) AND (est.property_id = 719,642))