explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sq2s

Settings
# exclusive inclusive rows x rows loops node
1. 2.395 30,120.015 ↓ 49.8 3,586 1

Sort (cost=779,094.80..779,094.98 rows=72 width=117) (actual time=30,119.502..30,120.015 rows=3,586 loops=1)

  • Sort Key: sub_query1.date
  • Sort Method: quicksort Memory: 377kB
2.          

CTE eligible_ar_codes

3. 0.003 0.713 ↓ 0.0 0 1

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

4. 0.003 0.706 ↑ 1.0 2 1

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

5. 0.691 0.691 ↑ 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.689..0.691 rows=2 loops=1)

  • Index Cond: (property_id = 518720)
  • Filter: (cid = 2342)
6. 0.012 0.012 ↑ 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.006..0.006 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.000 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.014 0.014 ↓ 0.0 0 1

Seq Scan on property_holidays ph (cost=0.00..1.81 rows=1 width=8) (actual time=0.014..0.014 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. 4.593 4.593 ↓ 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=3.321..4.593 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.063 0.063 ↑ 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.018..0.063 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. 33.530 33.530 ↓ 0.0 0 1

Index Scan using idx_late_fee_batch_details_property_id on late_fee_batch_details (cost=0.42..1,908.63 rows=59 width=192) (actual time=33.530..33.530 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..2.07 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. 20.410 30,117.620 ↓ 49.8 3,586 1

Merge Join (cost=346,767.53..777,134.18 rows=72 width=117) (actual time=26,340.919..30,117.620 rows=3,586 loops=1)

  • Merge Cond: (art.lease_id = sub_query1.lease_id)
  • Join Filter: (sub_query1.date = days.date)
  • Rows Removed by Join Filter: 78184
21. 426.684 11,195.671 ↑ 483.4 5,977 1

Finalize GroupAggregate (cost=330,754.53..724,750.96 rows=2,889,387 width=16) (actual time=7,707.965..11,195.671 rows=5,977 loops=1)

  • Group Key: art.lease_id, art.cid, days.date
  • Filter: (sum(art.transaction_amount) > '0'::numeric)
  • Rows Removed by Filter: 136116
22. 0.000 10,768.987 ↑ 7.6 335,475 1

Gather Merge (cost=330,754.53..656,776.80 rows=2,548,546 width=48) (actual time=7,696.801..10,768.987 rows=335,475 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
23. 4,875.417 29,848.122 ↑ 11.4 111,825 3

Partial GroupAggregate (cost=329,754.50..361,611.33 rows=1,274,273 width=48) (actual time=7,312.462..9,949.374 rows=111,825 loops=3)

  • Group Key: art.lease_id, art.cid, days.date
24. 12,847.347 24,972.705 ↓ 2.3 2,873,870 3

Sort (cost=329,754.50..332,940.18 rows=1,274,273 width=21) (actual time=7,312.247..8,324.235 rows=2,873,870 loops=3)

  • Sort Key: art.lease_id, days.date
  • Sort Method: external merge Disk: 80384kB
25. 2,133.270 12,125.358 ↓ 2.3 2,873,870 3

Nested Loop (cost=3,527.93..200,535.30 rows=1,274,273 width=21) (actual time=517.390..4,041.786 rows=2,873,870 loops=3)

26. 6,701.572 7,226.226 ↑ 1.2 51,220 3

Parallel Bitmap Heap Scan on ar_transactions art (cost=3,527.64..141,456.44 rows=62,669 width=17) (actual time=516.097..2,408.742 rows=51,220 loops=3)

  • Recheck Cond: (property_id = 518720)
  • Filter: ((NOT is_deleted) AND (cid = 2342))
  • Rows Removed by Filter: 1496
  • Heap Blocks: exact=3664
27. 524.654 524.654 ↓ 1.0 162,327 1

Bitmap Index Scan on idx_ar_transactions_property_id (cost=0.00..3,490.04 rows=155,948 width=0) (actual time=524.654..524.654 rows=162,327 loops=1)

  • Index Cond: (property_id = 518720)
28. 2,765.862 2,765.862 ↓ 2.8 56 153,659

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

  • 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. 7.826 18,901.539 ↓ 81,777.0 81,777 1

Materialize (cost=16,013.00..16,013.07 rows=1 width=117) (actual time=18,526.871..18,901.539 rows=81,777 loops=1)

30. 331.097 18,893.713 ↓ 3,608.0 3,608 1

GroupAggregate (cost=16,013.00..16,013.06 rows=1 width=117) (actual time=18,526.868..18,893.713 rows=3,608 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: 41036
31. 316.516 18,562.616 ↓ 412,542.0 412,542 1

Sort (cost=16,013.00..16,013.01 rows=1 width=117) (actual time=18,526.628..18,562.616 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. 216.368 18,246.100 ↓ 412,542.0 412,542 1

Subquery Scan on sub_query1 (cost=16,012.88..16,012.99 rows=1 width=117) (actual time=17,172.771..18,246.100 rows=412,542 loops=1)

  • Filter: (NOT (SubPlan 7))
33. 731.669 18,029.732 ↓ 412,542.0 412,542 1

GroupAggregate (cost=16,012.88..16,012.97 rows=1 width=143) (actual time=17,172.764..18,029.732 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. 2,399.528 17,298.063 ↓ 669,470.0 669,470 1

Sort (cost=16,012.88..16,012.88 rows=1 width=52) (actual time=17,172.749..17,298.063 rows=669,470 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. 181.030 14,898.535 ↓ 669,470.0 669,470 1

Nested Loop Anti Join (cost=1,095.99..16,012.87 rows=1 width=52) (actual time=3,394.942..14,898.535 rows=669,470 loops=1)

  • Join Filter: ((r.starts_on > days_1.date) AND (r.cid = l.cid) AND (r.lease_id = l.id))
36. 232.150 14,048.035 ↓ 669,470.0 669,470 1

Nested Loop Anti Join (cost=1,095.69..16,009.29 rows=1 width=60) (actual time=3,394.923..14,048.035 rows=669,470 loops=1)

  • Join Filter: ((NOT lff.charge_late_fees_on_holidays) AND (phl.cid = l.cid) AND (phl.date = days_1.date))
37. 333.572 13,815.885 ↓ 669,470.0 669,470 1

Nested Loop Left Join (cost=1,095.69..16,009.25 rows=1 width=61) (actual time=3,394.905..13,815.885 rows=669,470 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. 743.074 13,482.313 ↓ 669,470.0 669,470 1

Nested Loop Left Join (cost=1,095.69..16,007.76 rows=1 width=61) (actual time=3,361.371..13,482.313 rows=669,470 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: 36289
39. 45.082 7,788.735 ↓ 412,542.0 412,542 1

Nested Loop Left Join (cost=1,090.58..15,970.35 rows=1 width=61) (actual time=3,352.537..7,788.735 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. 0.000 7,331.111 ↓ 412,542.0 412,542 1

Nested Loop (cost=1,090.58..15,970.31 rows=1 width=69) (actual time=3,352.532..7,331.111 rows=412,542 loops=1)

41. 1,556.459 6,952.677 ↓ 412,542.0 412,542 1

Nested Loop (cost=1,090.58..15,970.27 rows=1 width=69) (actual time=3,347.935..6,952.677 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: 4074018
42. 23.690 4,573.682 ↓ 74,776.0 74,776 1

Nested Loop (cost=1,090.58..15,968.71 rows=1 width=67) (actual time=3,347.809..4,573.682 rows=74,776 loops=1)

43. 59.041 4,400.440 ↓ 74,776.0 74,776 1

Nested Loop (cost=1,090.31..15,965.18 rows=1 width=70) (actual time=3,346.253..4,400.440 rows=74,776 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. 196.818 3,531.737 ↓ 766.0 766 1

Nested Loop (cost=1,089.88..15,937.35 rows=1 width=51) (actual time=3,343.494..3,531.737 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: 1695530
45. 110.687 110.687 ↑ 1.0 552 1

Index Scan using idx_late_fee_formulas on late_fee_formulas lff (cost=0.28..47.39 rows=552 width=24) (actual time=0.011..110.687 rows=552 loops=1)

  • Filter: (cid = 2342)
46. 108.164 3,224.232 ↓ 3,073.0 3,073 552

Materialize (cost=1,089.60..15,876.85 rows=1 width=40) (actual time=0.288..5.841 rows=3,073 loops=552)

47. 1.535 3,116.068 ↓ 3,073.0 3,073 1

Nested Loop (cost=1,089.60..15,876.85 rows=1 width=40) (actual time=158.669..3,116.068 rows=3,073 loops=1)

48. 4.103 3,089.949 ↓ 3,073.0 3,073 1

Nested Loop (cost=1,089.33..15,868.55 rows=1 width=40) (actual time=149.574..3,089.949 rows=3,073 loops=1)

  • Join Filter: ((l.id = li.lease_id) AND (l.active_lease_interval_id = li.id))
  • Rows Removed by Join Filter: 180
49. 1.548 1,637.114 ↓ 3,884.0 3,884 1

Nested Loop (cost=1,088.91..15,863.64 rows=1 width=32) (actual time=135.211..1,637.114 rows=3,884 loops=1)

  • Join Filter: (l.id = ld.lease_id)
50. 0.000 128.574 ↓ 3,884.0 3,884 1

Gather (cost=1,088.48..15,859.58 rows=1 width=28) (actual time=123.301..128.574 rows=3,884 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
51. 820.107 937.803 ↓ 1,942.0 1,942 2

Nested Loop (cost=88.48..14,859.48 rows=1 width=28) (actual time=119.246..937.803 rows=1,942 loops=2)

52. 24.032 117.275 ↑ 1.1 1,942 2

Parallel Bitmap Heap Scan on leases l (cost=88.06..5,154.45 rows=2,098 width=24) (actual time=94.204..117.275 rows=1,942 loops=2)

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

Bitmap Index Scan on idx_leases_property_id (cost=0.00..87.17 rows=3,566 width=0) (actual time=93.243..93.243 rows=4,015 loops=1)

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

Index Only Scan using idx_lease_customers_cid_lease_id_customer_id_lease_status_type_ on lease_customers lc (cost=0.42..4.63 rows=1 width=16) (actual time=0.421..0.421 rows=1 loops=3,885)

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

Index Scan using idx_lease_details_lease_id on lease_details ld (cost=0.42..4.04 rows=1 width=8) (actual time=0.376..0.388 rows=1 loops=3,884)

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

Index Scan using idx_lease_intervals_major_composite on lease_intervals li (cost=0.42..4.90 rows=1 width=16) (actual time=0.351..0.373 rows=1 loops=3,884)

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

Index Scan using idx_property_gl_settings_cid_property_id_activate_po_posting on property_gl_settings pgs (cost=0.27..8.29 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=3,073)

  • Index Cond: ((cid = 2342) AND (property_id = 518720))
  • Filter: activate_standard_posting
58. 809.662 809.662 ↓ 49.0 98 766

Index Scan using idx_ar_transactions_allocations_join on ar_transactions at (cost=0.43..6.44 rows=2 width=41) (actual time=0.639..1.057 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,776

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,776)

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

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,776)

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

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

  • 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.000..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. 2,475.252 4,950.504 ↑ 6.5 2 412,542

Bitmap Heap Scan on ar_allocations aa (cost=5.11..37.14 rows=13 width=21) (actual time=0.011..0.012 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=427233
70. 412.542 2,475.252 ↓ 0.0 0 412,542

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

71. 825.084 825.084 ↑ 2.0 1 412,542

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

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

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

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

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

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

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,470)

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

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

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

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,470)

  • 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))
Planning time : 838.250 ms
Execution time : 30,201.165 ms