explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QcjY

Settings
# exclusive inclusive rows x rows loops node
1. 2.861 26,851.962 ↓ 49.1 3,583 1

Sort (cost=780,594.37..780,594.55 rows=73 width=117) (actual time=26,851.449..26,851.962 rows=3,583 loops=1)

  • Sort Key: sub_query1.date
  • Sort Method: quicksort Memory: 376kB
  • Planning time: 69.164 ms
  • Execution time: 26921.401 ms
2.          

CTE eligible_ar_codes

3. 0.002 0.040 ↓ 0.0 0 1

Nested Loop (cost=0.70..25.98 rows=1 width=12) (actual time=0.040..0.040 rows=0 loops=1)

4. 0.005 0.034 ↑ 1.0 2 1

Nested Loop (cost=0.55..25.25 rows=2 width=16) (actual time=0.030..0.034 rows=2 loops=1)

5. 0.019 0.019 ↑ 1.0 2 1

Index Scan using idx_property_late_fees_property_id on property_late_fee_formulas plff (cost=0.28..8.63 rows=2 width=8) (actual time=0.018..0.019 rows=2 loops=1)

  • Index Cond: (property_id = 518720)
  • Filter: (cid = 2342)
6. 0.010 0.010 ↑ 1.0 1 2

Index Scan using idx_late_fee_formulas on late_fee_formulas lff_1 (cost=0.28..8.29 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=2)

  • Index Cond: (id = plff.late_fee_formula_id)
  • Filter: ((NOT is_disabled) AND (cid = 2342))
7. 0.004 0.004 ↓ 0.0 0 2

Index Scan using idx_late_fee_formula_ar_codes_late_fee_formula_id on late_fee_formula_ar_codes lffac (cost=0.15..0.35 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=2)

  • Index Cond: (late_fee_formula_id = lff_1.id)
  • Filter: (cid = 2342)
8.          

CTE property_holiday_list

9. 0.001 0.014 ↓ 0.0 0 1

Nested Loop (cost=0.00..3.19 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=1)

  • Join Filter: (ph.company_holiday_id = ch.id)
10. 0.013 0.013 ↓ 0.0 0 1

Seq Scan on property_holidays ph (cost=0.00..1.81 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=1)

  • Filter: ((cid = 2342) AND (property_id = 518720))
  • Rows Removed by Filter: 54
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on company_holidays ch (cost=0.00..1.37 rows=1 width=12) (never executed)

  • Filter: ((date >= '2019-04-07'::date) AND (date <= '2019-06-05'::date) AND (cid = 2342))
12.          

CTE eligible_property_preferences

13. 0.084 0.084 ↓ 2.0 2 1

Index Scan using uk_property_preferences_cid_property_id_key on property_preferences (cost=0.41..12.87 rows=1 width=53) (actual time=0.074..0.084 rows=2 loops=1)

  • Index Cond: ((cid = 2342) AND (property_id = 518720) AND ((key)::text = ANY ('{ENABLED_LATE_FEES,CHARGE_LATE_FEES_FOR_EVICTING_LEASES}'::text[])))
14.          

CTE eligible_days

15. 0.072 0.072 ↑ 1.0 60 1

Index Only Scan using uk_days_date on days days_2 (cost=0.29..5.66 rows=61 width=16) (actual time=0.050..0.072 rows=60 loops=1)

  • Index Cond: ((date >= '2019-04-07 00:00:00'::timestamp without time zone) AND (date <= '2019-06-05 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
16.          

CTE eligible_late_fee_batch_details

17. 0.266 0.266 ↓ 0.0 0 1

Index Scan using idx_late_fee_batch_details_property_id on late_fee_batch_details (cost=0.42..1,793.44 rows=55 width=191) (actual time=0.266..0.266 rows=0 loops=1)

  • Index Cond: (property_id = 518720)
  • Filter: ((post_date >= '2019-04-07'::date) AND (post_date <= '2019-06-05'::date) AND (cid = 2342))
  • Rows Removed by Filter: 648
18.          

CTE property_waive_late_fees

19. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on eligible_late_fee_batch_details lfbd_1 (cost=0.00..1.93 rows=1 width=20) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((post_date >= '2019-04-07'::date) AND (post_date <= '2019-06-05'::date) AND (cid = 2342) AND (property_id = 518720) AND (late_fee_action_type_id = 2) AND (is_expired = 0))
20. 25.976 26,849.101 ↓ 49.1 3,583 1

Merge Join (cost=346,557.16..778,749.05 rows=73 width=117) (actual time=22,178.015..26,849.101 rows=3,583 loops=1)

  • Merge Cond: (art.lease_id = sub_query1.lease_id)
  • Join Filter: (sub_query1.date = days.date)
  • Rows Removed by Join Filter: 78166
21. 586.140 10,569.373 ↑ 487.7 5,974 1

Finalize GroupAggregate (cost=331,203.58..726,724.25 rows=2,913,299 width=16) (actual time=6,366.404..10,569.373 rows=5,974 loops=1)

  • Group Key: art.lease_id, art.cid, days.date
  • Filter: (sum(art.transaction_amount) > '0'::numeric)
  • Rows Removed by Filter: 136119
22. 0.000 9,983.233 ↑ 7.6 335,285 1

Gather Merge (cost=331,203.58..658,342.12 rows=2,557,272 width=48) (actual time=6,354.819..9,983.233 rows=335,285 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
23. 6,579.219 28,982.250 ↑ 11.4 111,762 3

Partial GroupAggregate (cost=330,203.55..362,169.45 rows=1,278,636 width=48) (actual time=6,297.948..9,660.750 rows=111,762 loops=3)

  • Group Key: art.lease_id, art.cid, days.date
24. 15,226.608 22,403.031 ↓ 2.2 2,873,870 3

Sort (cost=330,203.55..333,400.14 rows=1,278,636 width=21) (actual time=6,297.912..7,467.677 rows=2,873,870 loops=3)

  • Sort Key: art.lease_id, days.date
  • Sort Method: external merge Disk: 92736kB
25. 2,924.817 7,176.423 ↓ 2.2 2,873,870 3

Nested Loop (cost=3,524.66..200,510.39 rows=1,278,636 width=21) (actual time=12.837..2,392.141 rows=2,873,870 loops=3)

26. 395.220 411.606 ↑ 1.2 51,200 3

Parallel Bitmap Heap Scan on ar_transactions art (cost=3,524.37..141,229.43 rows=62,884 width=17) (actual time=12.705..137.202 rows=51,200 loops=3)

  • Recheck Cond: (property_id = 518720)
  • Filter: ((NOT is_deleted) AND (cid = 2342))
  • Rows Removed by Filter: 1495
  • Heap Blocks: exact=5153
27. 16.386 16.386 ↓ 1.0 162,291 1

Bitmap Index Scan on idx_ar_transactions_property_id (cost=0.00..3,486.64 rows=156,028 width=0) (actual time=16.386..16.386 rows=162,291 loops=1)

  • Index Cond: (property_id = 518720)
28. 3,840.000 3,840.000 ↓ 2.8 56 153,600

Index Only Scan using uk_days_date on days (cost=0.29..0.74 rows=20 width=8) (actual time=0.010..0.025 rows=56 loops=153,600)

  • Index Cond: ((date >= art.post_date) AND (date >= '2019-04-07 00:00:00'::timestamp without time zone) AND (date <= '2019-06-05 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
29. 15.835 16,253.752 ↓ 81,756.0 81,756 1

Materialize (cost=15,353.59..15,353.65 rows=1 width=117) (actual time=15,669.472..16,253.752 rows=81,756 loops=1)

30. 506.823 16,237.917 ↓ 3,605.0 3,605 1

GroupAggregate (cost=15,353.59..15,353.64 rows=1 width=117) (actual time=15,669.464..16,237.917 rows=3,605 loops=1)

  • Group Key: sub_query1.lease_id, sub_query1.cid, sub_query1.late_fee_formula_id, sub_query1.date, sub_query1.base_charge_on_amount_due
  • Filter: CASE WHEN (NOT sub_query1.base_charge_on_amount_due) THEN (sum(sub_query1.transaction_amount) > '0'::numeric) ELSE (sum(sub_query1.transaction_amount_due) > '0'::numeric) END
  • Rows Removed by Filter: 41039
31. 603.995 15,731.094 ↓ 412,542.0 412,542 1

Sort (cost=15,353.59..15,353.59 rows=1 width=117) (actual time=15,669.215..15,731.094 rows=412,542 loops=1)

  • Sort Key: sub_query1.lease_id, sub_query1.late_fee_formula_id, sub_query1.date, sub_query1.base_charge_on_amount_due
  • Sort Method: quicksort Memory: 44518kB
32. 337.128 15,127.099 ↓ 412,542.0 412,542 1

Subquery Scan on sub_query1 (cost=15,353.46..15,353.58 rows=1 width=117) (actual time=13,699.990..15,127.099 rows=412,542 loops=1)

  • Filter: (NOT (SubPlan 7))
33. 935.826 14,789.971 ↓ 412,542.0 412,542 1

GroupAggregate (cost=15,353.46..15,353.55 rows=1 width=143) (actual time=13,699.983..14,789.971 rows=412,542 loops=1)

  • Group Key: li.lease_id, l.cid, at.id, at.transaction_amount, lfbd.late_fee_formula_id, at.ar_trigger_id, lff.id, ac.waive_late_fees, at.ar_code_type_id, at.post_date, days_1.date, lff.base_charge_on_amount_due
34. 3,227.363 13,854.145 ↓ 669,473.0 669,473 1

Sort (cost=15,353.46..15,353.46 rows=1 width=52) (actual time=13,699.964..13,854.145 rows=669,473 loops=1)

  • Sort Key: li.lease_id, at.id, at.transaction_amount, lfbd.late_fee_formula_id, at.ar_trigger_id, lff.id, ac.waive_late_fees, at.ar_code_type_id, at.post_date, days_1.date, lff.base_charge_on_amount_due
  • Sort Method: external merge Disk: 46968kB
35. 507.568 10,626.782 ↓ 669,473.0 669,473 1

Nested Loop Anti Join (cost=1,112.97..15,353.45 rows=1 width=52) (actual time=200.491..10,626.782 rows=669,473 loops=1)

  • Join Filter: ((r.starts_on > days_1.date) AND (r.cid = l.cid) AND (r.lease_id = l.id))
36. 284.486 9,449.741 ↓ 669,473.0 669,473 1

Nested Loop Anti Join (cost=1,112.67..15,349.87 rows=1 width=60) (actual time=200.476..9,449.741 rows=669,473 loops=1)

  • Join Filter: ((NOT lff.charge_late_fees_on_holidays) AND (phl.cid = l.cid) AND (phl.date = days_1.date))
37. 364.414 9,165.255 ↓ 669,473.0 669,473 1

Nested Loop Left Join (cost=1,112.67..15,349.84 rows=1 width=61) (actual time=200.461..9,165.255 rows=669,473 loops=1)

  • Join Filter: ((lfbd.cid = lff.cid) AND (l.id = lfbd.lease_id) AND (lfbd.late_fee_formula_id = lff.id) AND (lfbd.post_date = days_1.date) AND (lfbd.ar_transaction_id = at.id))
38. 932.257 8,800.841 ↓ 669,473.0 669,473 1

Nested Loop Left Join (cost=1,112.67..15,348.44 rows=1 width=61) (actual time=200.192..8,800.841 rows=669,473 loops=1)

  • Join Filter: CASE WHEN (NOT lff.include_past_period_transactions) THEN ((aa.post_date >= date_trunc('MONTH'::text, days_1.date)) AND (aa.post_date <= days_1.date)) ELSE (aa.post_date <= days_1.date) END
  • Rows Removed by Join Filter: 35582
39. 176.836 5,393.332 ↓ 412,542.0 412,542 1

Nested Loop Left Join (cost=1,107.56..15,311.02 rows=1 width=61) (actual time=200.138..5,393.332 rows=412,542 loops=1)

  • Join Filter: ((l.cid = pp1.cid) AND (l.property_id = pp1.property_id))
  • Filter: CASE WHEN (pp1.value = '0'::text) THEN ((l.termination_list_type_id <> 1) OR (l.termination_list_type_id IS NULL)) ELSE true END
40. 82.314 4,803.954 ↓ 412,542.0 412,542 1

Nested Loop (cost=1,107.56..15,310.97 rows=1 width=69) (actual time=200.135..4,803.954 rows=412,542 loops=1)

41. 2,202.984 4,309.098 ↓ 412,542.0 412,542 1

Nested Loop (cost=1,107.56..15,310.93 rows=1 width=69) (actual time=200.045..4,309.098 rows=412,542 loops=1)

  • Join Filter: (CASE WHEN (NOT lff.charge_late_fees_on_saturdays) THEN ('6'::double precision <> days_1.day_of_week) ELSE true END AND CASE WHEN (NOT lff.charge_late_fees_on_sundays) THEN ('0'::double precision <> days_1.day_of_week) ELSE true END AND CASE WHEN (NOT lff.include_past_period_transactions) THEN (at.post_date >= date_trunc('MONTH'::text, days_1.date)) ELSE true END AND ((at.post_date + ('1 day'::interval * (lff.grace_days)::double precision)) <= days_1.date))
  • Rows Removed by Join Filter: 4072038
42. 68.772 984.969 ↓ 74,743.0 74,743 1

Nested Loop (cost=1,107.56..15,309.37 rows=1 width=67) (actual time=199.920..984.969 rows=74,743 loops=1)

43. 68.104 766.711 ↓ 74,743.0 74,743 1

Nested Loop (cost=1,107.28..15,305.85 rows=1 width=70) (actual time=199.897..766.711 rows=74,743 loops=1)

  • Join Filter: ((l.id = at.lease_id) AND CASE WHEN lff.scheduled_charges_only THEN ((at.scheduled_charge_id IS NOT NULL) OR (at.transaction_amount < '0'::numeric) OR (at.ar_trigger_id = 401)) ELSE true END AND CASE WHEN (li.late_fee_formula_id <> lff.id) THEN (((SubPlan 8) OR (at.ar_trigger_id = 401)) AND (NOT lff.is_disabled)) ELSE (NOT (SubPlan 9)) END)
44. 296.139 523.193 ↓ 766.0 766 1

Nested Loop (cost=1,106.85..15,278.02 rows=1 width=51) (actual time=199.124..523.193 rows=766 loops=1)

  • Join Filter: (((li.late_fee_formula_id = lff.parent_late_fee_formula_id) OR (li.late_fee_formula_id = lff.id)) AND CASE WHEN (NOT lff.include_future_leases) THEN (lc.lease_status_type_id = ANY ('{4,5}'::integer[])) ELSE (lc.lease_status_type_id = ANY ('{4,5,3}'::integer[])) END)
  • Rows Removed by Join Filter: 1691114
45. 0.734 0.734 ↑ 1.0 552 1

Index Scan using idx_late_fee_formulas on late_fee_formulas lff (cost=0.28..47.34 rows=552 width=24) (actual time=0.010..0.734 rows=552 loops=1)

  • Filter: (cid = 2342)
46. 165.865 226.320 ↓ 3,065.0 3,065 552

Materialize (cost=1,106.58..15,217.58 rows=1 width=40) (actual time=0.005..0.410 rows=3,065 loops=552)

47. 2.582 60.455 ↓ 3,065.0 3,065 1

Nested Loop (cost=1,106.58..15,217.57 rows=1 width=40) (actual time=2.612..60.455 rows=3,065 loops=1)

48. 4.236 51.743 ↓ 3,065.0 3,065 1

Nested Loop (cost=1,106.31..15,213.27 rows=1 width=40) (actual time=2.557..51.743 rows=3,065 loops=1)

  • Join Filter: ((l.id = li.lease_id) AND (l.active_lease_interval_id = li.id))
  • Rows Removed by Join Filter: 181
49. 2.976 24.263 ↓ 3,874.0 3,874 1

Nested Loop (cost=1,105.88..15,208.37 rows=1 width=32) (actual time=2.529..24.263 rows=3,874 loops=1)

  • Join Filter: (l.id = ld.lease_id)
50. 0.000 5.791 ↓ 3,874.0 3,874 1

Gather (cost=1,105.46..15,204.33 rows=1 width=28) (actual time=2.504..5.791 rows=3,874 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
51. 12.108 18.249 ↓ 1,937.0 1,937 2

Nested Loop (cost=105.46..14,204.23 rows=1 width=28) (actual time=0.492..18.249 rows=1,937 loops=2)

52. 5.482 6.135 ↑ 1.3 1,938 2

Parallel Bitmap Heap Scan on leases l (cost=105.03..5,426.99 rows=2,475 width=24) (actual time=0.442..6.135 rows=1,938 loops=2)

  • Recheck Cond: (property_id = 518720)
  • Filter: ((cid = 2342) AND (occupancy_type_id <> ALL ('{5,7,8}'::integer[])))
  • Heap Blocks: exact=9
53. 0.653 0.653 ↑ 1.1 4,005 1

Bitmap Index Scan on idx_leases_property_id (cost=0.00..103.98 rows=4,208 width=0) (actual time=0.653..0.653 rows=4,005 loops=1)

  • Index Cond: (property_id = 518720)
54. 0.006 0.006 ↑ 1.0 1 3,875

Index Only Scan using idx_lease_customers_cid_lease_id_customer_id_lease_status_type_ on lease_customers lc (cost=0.42..3.55 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=3,875)

  • Index Cond: ((cid = 2342) AND (lease_id = l.id) AND (customer_id = l.primary_customer_id))
  • Heap Fetches: 218
55. 15.496 15.496 ↑ 1.0 1 3,874

Index Scan using idx_lease_details_lease_id on lease_details ld (cost=0.42..4.03 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=3,874)

  • Index Cond: (lease_id = lc.lease_id)
  • Filter: ((cid = 2342) AND (dont_charge_late_fees = 0))
56. 23.244 23.244 ↑ 1.0 1 3,874

Index Scan using idx_lease_intervals_major_composite on lease_intervals li (cost=0.42..4.88 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=3,874)

  • Index Cond: ((cid = 2342) AND (lease_id = lc.lease_id))
  • Filter: (lease_status_type_id <> 2)
  • Rows Removed by Filter: 0
57. 6.130 6.130 ↑ 1.0 1 3,065

Index Only Scan using idx_property_gl_settings_cid_property_id_activate_standard_post on property_gl_settings pgs (cost=0.27..4.29 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=3,065)

  • Index Cond: ((cid = 2342) AND (property_id = 518720) AND (activate_standard_posting = true))
  • Filter: activate_standard_posting
  • Heap Fetches: 3065
58. 175.414 175.414 ↓ 49.0 98 766

Index Scan using idx_ar_transactions_allocations_join on ar_transactions at (cost=0.43..6.43 rows=2 width=41) (actual time=0.016..0.229 rows=98 loops=766)

  • Index Cond: ((cid = 2342) AND (property_id = 518720) AND (lease_id = lc.lease_id))
  • Filter: ((NOT is_deleted) AND CASE WHEN ((ar_code_type_id = ANY ('{2,5,6,4,3,9,8}'::integer[])) OR ((ar_code_type_id = 7) AND (NOT is_deposit_credit))) THEN (NOT is_temporary) ELSE true END)
  • Rows Removed by Filter: 2
59.          

SubPlan (forNested Loop)

60. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on late_fee_formula_ar_codes (cost=8.65..12.66 rows=1 width=4) (never executed)

  • Recheck Cond: ((late_fee_formula_id = lff.id) AND (cid = lff.cid))
61. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=8.65..8.65 rows=1 width=0) (never executed)

62. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_late_fee_formula_ar_codes_late_fee_formula_id (cost=0.00..4.20 rows=6 width=0) (never executed)

  • Index Cond: (late_fee_formula_id = lff.id)
63. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on pk_late_fee_formula_ar_codes (cost=0.00..4.20 rows=6 width=0) (never executed)

  • Index Cond: (cid = lff.cid)
64. 0.000 0.000 ↓ 0.0 0 74,743

CTE Scan on eligible_ar_codes eac (cost=0.00..0.03 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=74,743)

  • Filter: ((parent_late_fee_formula_id = lff.id) AND (cid = lff.cid))
65. 149.486 149.486 ↑ 1.0 1 74,743

Index Scan using pk_ar_codes on ar_codes ac (cost=0.28..3.52 rows=1 width=9) (actual time=0.002..0.002 rows=1 loops=74,743)

  • Index Cond: ((cid = 2342) AND (id = at.ar_code_id))
66. 1,121.145 1,121.145 ↓ 60.0 60 74,743

CTE Scan on eligible_days days_1 (cost=0.00..1.53 rows=1 width=16) (actual time=0.000..0.015 rows=60 loops=74,743)

  • Filter: ((date >= '2019-04-07 00:00:00'::timestamp without time zone) AND (date <= '2019-06-05 00:00:00'::timestamp without time zone))
67. 412.542 412.542 ↑ 1.0 1 412,542

CTE Scan on eligible_property_preferences pp (cost=0.00..0.03 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=412,542)

  • Filter: ((cid = 2342) AND (property_id = 518720) AND ((key)::text = 'ENABLED_LATE_FEES'::text) AND (value = '1'::text))
  • Rows Removed by Filter: 1
68. 412.542 412.542 ↑ 1.0 1 412,542

CTE Scan on eligible_property_preferences pp1 (cost=0.00..0.03 rows=1 width=40) (actual time=0.000..0.001 rows=1 loops=412,542)

  • Filter: ((cid = 2342) AND (property_id = 518720) AND ((key)::text = 'CHARGE_LATE_FEES_FOR_EVICTING_LEASES'::text))
  • Rows Removed by Filter: 1
69. 825.084 2,475.252 ↑ 7.0 2 412,542

Bitmap Heap Scan on ar_allocations aa (cost=5.11..37.14 rows=14 width=21) (actual time=0.005..0.006 rows=2 loops=412,542)

  • Recheck Cond: ((at.id = charge_ar_transaction_id) OR (at.id = credit_ar_transaction_id))
  • Filter: ((NOT is_deleted) AND (cid = 2342) AND (cid = at.cid))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=429073
70. 0.000 1,650.168 ↓ 0.0 0 412,542

BitmapOr (cost=5.11..5.11 rows=14 width=0) (actual time=0.004..0.004 rows=0 loops=412,542)

71. 825.084 825.084 ↑ 3.0 1 412,542

Bitmap Index Scan on idx_ar_allocations_charge_ar_transaction_id (cost=0.00..2.52 rows=3 width=0) (actual time=0.002..0.002 rows=1 loops=412,542)

  • Index Cond: (at.id = charge_ar_transaction_id)
72. 825.084 825.084 ↑ 12.0 1 412,542

Bitmap Index Scan on idx_ar_allocations_credit_ar_transaction_id (cost=0.00..2.58 rows=12 width=0) (actual time=0.002..0.002 rows=1 loops=412,542)

  • Index Cond: (at.id = credit_ar_transaction_id)
73. 0.000 0.000 ↓ 0.0 0 669,473

CTE Scan on eligible_late_fee_batch_details lfbd (cost=0.00..1.38 rows=1 width=20) (actual time=0.000..0.000 rows=0 loops=669,473)

  • Filter: ((cid = 2342) AND (late_fee_action_type_id = 1))
74. 0.000 0.000 ↓ 0.0 0 669,473

CTE Scan on property_holiday_list phl (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=669,473)

  • Filter: (cid = 2342)
75. 0.000 669.473 ↓ 0.0 0 669,473

Nested Loop (cost=0.30..3.56 rows=1 width=24) (actual time=0.001..0.001 rows=0 loops=669,473)

  • Join Filter: (r.id = rat.repayment_id)
76. 669.473 669.473 ↓ 0.0 0 669,473

Index Scan using idx_repayments_property_id on repayments r (cost=0.15..1.77 rows=1 width=24) (actual time=0.001..0.001 rows=0 loops=669,473)

  • Index Cond: ((cid = 2342) AND (property_id = at.property_id) AND (property_id = 518720))
  • Filter: is_active
77. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_repayment_ar_transactions_cid_ar_transaction_id on repayment_ar_transactions rat (cost=0.15..1.78 rows=1 width=16) (never executed)

  • Index Cond: ((cid = 2342) AND (ar_transaction_id = at.id))
  • Filter: (property_id = 518720)
78.          

SubPlan (forSubquery Scan)

79. 0.000 0.000 ↓ 0.0 0 412,542

CTE Scan on property_waive_late_fees pwlf (cost=0.00..0.03 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=412,542)

  • Filter: ((late_fee_formula_id = sub_query1.late_fee_formula_id) AND (cid = sub_query1.cid) AND (post_date = sub_query1.date) AND (lease_id = sub_query1.lease_id))