explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OE73

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.469 2,210.690 ↑ 1.6 368 1

Unique (cost=83,193.26..83,238.90 rows=589 width=2,031) (actual time=2,210.151..2,210.690 rows=368 loops=1)

2.          

CTE transition_events

3. 8.684 39.281 ↑ 1.1 5,579 1

Finalize GroupAggregate (cost=1,639.54..1,752.26 rows=5,893 width=20) (actual time=28.115..39.281 rows=5,579 loops=1)

  • Group Key: loan_status_transition_events.loan_application_id, loan_status_transition_events.to_status
4. 5.785 30.597 ↓ 1.5 5,898 1

Sort (cost=1,639.54..1,649.30 rows=3,906 width=20) (actual time=28.070..30.597 rows=5,898 loops=1)

  • Sort Key: loan_status_transition_events.loan_application_id, loan_status_transition_events.to_status
  • Sort Method: quicksort Memory: 653kB
5. 8.208 24.812 ↓ 1.5 5,898 1

Gather (cost=976.85..1,406.51 rows=3,906 width=20) (actual time=21.286..24.812 rows=5,898 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
6. 3.295 16.604 ↑ 1.3 2,949 2 / 2

Partial HashAggregate (cost=966.85..1,005.91 rows=3,906 width=20) (actual time=15.470..16.604 rows=2,949 loops=2)

  • Group Key: loan_status_transition_events.loan_application_id, loan_status_transition_events.to_status
7. 13.309 13.309 ↑ 1.2 3,376 2 / 2

Parallel Seq Scan on loan_status_transition_events (cost=0.00..937.56 rows=3,906 width=20) (actual time=0.047..13.309 rows=3,376 loops=2)

  • Filter: (to_status = ANY ('{7,10}'::integer[]))
  • Rows Removed by Filter: 46,628
8.          

CTE team_mbrs

9. 0.054 0.054 ↑ 1.5 153 1

Seq Scan on team_members (cost=0.00..2.82 rows=222 width=116) (actual time=0.025..0.054 rows=153 loops=1)

10.          

CTE peoples

11. 0.079 0.079 ↓ 1.0 121 1

Index Scan using persons_pkey on persons (cost=0.14..2.40 rows=117 width=313) (actual time=0.011..0.079 rows=121 loops=1)

12.          

CTE team

13. 34.823 174.105 ↑ 1.0 22,012 1

Hash Left Join (cost=90.49..7,245.71 rows=22,013 width=232) (actual time=2.290..174.105 rows=22,012 loops=1)

  • Hash Cond: (tm_ma.person_id = p_ma.id)
14. 12.047 139.200 ↑ 1.0 22,012 1

Hash Left Join (cost=86.69..6,260.13 rows=22,013 width=400) (actual time=2.172..139.200 rows=22,012 loops=1)

  • Hash Cond: (lat.customer_care_member_id = tm_ma.id)
  • Join Filter: (NOT lat.is_removed)
15. 12.945 127.036 ↑ 1.0 22,012 1

Hash Left Join (cost=79.48..5,424.74 rows=22,013 width=401) (actual time=2.043..127.036 rows=22,012 loops=1)

  • Hash Cond: (lat.received_member_id = tm_re.id)
  • Join Filter: (NOT lat.is_removed)
16. 8.532 113.828 ↑ 1.0 22,012 1

Hash Left Join (cost=66.33..4,588.65 rows=22,013 width=345) (actual time=1.764..113.828 rows=22,012 loops=1)

  • Hash Cond: (lat.closer_member_id = tm_cl.id)
  • Join Filter: (NOT lat.is_removed)
17. 7.569 104.990 ↑ 1.0 22,012 1

Hash Left Join (cost=53.17..3,887.98 rows=22,013 width=289) (actual time=1.445..104.990 rows=22,012 loops=1)

  • Hash Cond: (lat.secondary_member_id = tm_s.id)
  • Join Filter: (NOT lat.is_removed)
18. 8.824 97.147 ↑ 1.0 22,012 1

Hash Left Join (cost=40.02..3,194.47 rows=22,013 width=233) (actual time=1.154..97.147 rows=22,012 loops=1)

  • Hash Cond: (lat.processor_member_id = tm_pr.id)
  • Join Filter: (NOT lat.is_removed)
19. 9.047 88.066 ↑ 1.0 22,012 1

Hash Left Join (cost=26.88..2,475.13 rows=22,013 width=177) (actual time=0.871..88.066 rows=22,012 loops=1)

  • Hash Cond: (lat.underwriter_member_id = tm_u.id)
  • Join Filter: (NOT lat.is_removed)
20. 8.944 78.769 ↑ 1.0 22,012 1

Hash Left Join (cost=13.72..1,752.52 rows=22,013 width=121) (actual time=0.608..78.769 rows=22,012 loops=1)

  • Hash Cond: (lat.quality_review_id = tm_q.id)
  • Join Filter: (NOT lat.is_removed)
21. 24.561 69.287 ↑ 1.0 22,012 1

Merge Left Join (cost=0.57..1,062.66 rows=22,013 width=65) (actual time=0.045..69.287 rows=22,012 loops=1)

  • Merge Cond: (la_1.id = lat.loan_application_id)
22. 12.728 12.728 ↓ 1.0 22,012 1

Index Only Scan using loan_applications_pkey on loan_applications la_1 (cost=0.29..337.10 rows=21,994 width=8) (actual time=0.026..12.728 rows=22,012 loops=1)

  • Heap Fetches: 6,329
23. 31.998 31.998 ↑ 1.0 22,004 1

Index Scan using loan_application_team_members_unique_per_loan on loan_application_team_members lat (cost=0.29..395.61 rows=22,013 width=65) (actual time=0.011..31.998 rows=22,004 loops=1)

24. 0.066 0.538 ↑ 1.5 153 1

Hash (cost=10.38..10.38 rows=222 width=72) (actual time=0.538..0.538 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
25. 0.111 0.472 ↑ 1.5 153 1

Hash Left Join (cost=3.80..10.38 rows=222 width=72) (actual time=0.297..0.472 rows=153 loops=1)

  • Hash Cond: (tm_q.person_id = p_q.id)
26. 0.127 0.127 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_q (cost=0.00..4.44 rows=222 width=16) (actual time=0.028..0.127 rows=153 loops=1)

27. 0.077 0.234 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.234..0.234 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
28. 0.157 0.157 ↓ 1.0 121 1

CTE Scan on peoples p_q (cost=0.00..2.34 rows=117 width=72) (actual time=0.013..0.157 rows=121 loops=1)

29. 0.050 0.250 ↑ 1.5 153 1

Hash (cost=10.38..10.38 rows=222 width=72) (actual time=0.250..0.250 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
30. 0.096 0.200 ↑ 1.5 153 1

Hash Left Join (cost=3.80..10.38 rows=222 width=72) (actual time=0.097..0.200 rows=153 loops=1)

  • Hash Cond: (tm_u.person_id = p_u.id)
31. 0.026 0.026 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_u (cost=0.00..4.44 rows=222 width=16) (actual time=0.001..0.026 rows=153 loops=1)

32. 0.041 0.078 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.078..0.078 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
33. 0.037 0.037 ↓ 1.0 121 1

CTE Scan on peoples p_u (cost=0.00..2.34 rows=117 width=72) (actual time=0.001..0.037 rows=121 loops=1)

34. 0.049 0.257 ↑ 1.5 153 1

Hash (cost=10.38..10.38 rows=222 width=72) (actual time=0.256..0.257 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
35. 0.094 0.208 ↑ 1.5 153 1

Hash Left Join (cost=3.80..10.38 rows=222 width=72) (actual time=0.100..0.208 rows=153 loops=1)

  • Hash Cond: (tm_pr.person_id = p_pr.id)
36. 0.031 0.031 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_pr (cost=0.00..4.44 rows=222 width=16) (actual time=0.001..0.031 rows=153 loops=1)

37. 0.046 0.083 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.083..0.083 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
38. 0.037 0.037 ↓ 1.0 121 1

CTE Scan on peoples p_pr (cost=0.00..2.34 rows=117 width=72) (actual time=0.001..0.037 rows=121 loops=1)

39. 0.070 0.274 ↑ 1.5 153 1

Hash (cost=10.38..10.38 rows=222 width=72) (actual time=0.274..0.274 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
40. 0.094 0.204 ↑ 1.5 153 1

Hash Left Join (cost=3.80..10.38 rows=222 width=72) (actual time=0.102..0.204 rows=153 loops=1)

  • Hash Cond: (tm_s.person_id = p_s.id)
41. 0.029 0.029 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_s (cost=0.00..4.44 rows=222 width=16) (actual time=0.001..0.029 rows=153 loops=1)

42. 0.040 0.081 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.081..0.081 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
43. 0.041 0.041 ↓ 1.0 121 1

CTE Scan on peoples p_s (cost=0.00..2.34 rows=117 width=72) (actual time=0.001..0.041 rows=121 loops=1)

44. 0.062 0.306 ↑ 1.5 153 1

Hash (cost=10.38..10.38 rows=222 width=72) (actual time=0.306..0.306 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
45. 0.136 0.244 ↑ 1.5 153 1

Hash Left Join (cost=3.80..10.38 rows=222 width=72) (actual time=0.103..0.244 rows=153 loops=1)

  • Hash Cond: (tm_cl.person_id = p_cl.id)
46. 0.023 0.023 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_cl (cost=0.00..4.44 rows=222 width=16) (actual time=0.001..0.023 rows=153 loops=1)

47. 0.045 0.085 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.085..0.085 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
48. 0.040 0.040 ↓ 1.0 121 1

CTE Scan on peoples p_cl (cost=0.00..2.34 rows=117 width=72) (actual time=0.002..0.040 rows=121 loops=1)

49. 0.047 0.263 ↑ 1.5 153 1

Hash (cost=10.38..10.38 rows=222 width=72) (actual time=0.263..0.263 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
50. 0.102 0.216 ↑ 1.5 153 1

Hash Left Join (cost=3.80..10.38 rows=222 width=72) (actual time=0.109..0.216 rows=153 loops=1)

  • Hash Cond: (tm_re.person_id = p_re.id)
51. 0.023 0.023 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_re (cost=0.00..4.44 rows=222 width=16) (actual time=0.001..0.023 rows=153 loops=1)

52. 0.050 0.091 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.091..0.091 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
53. 0.041 0.041 ↓ 1.0 121 1

CTE Scan on peoples p_re (cost=0.00..2.34 rows=117 width=72) (actual time=0.001..0.041 rows=121 loops=1)

54. 0.055 0.117 ↑ 1.5 153 1

Hash (cost=4.44..4.44 rows=222 width=16) (actual time=0.117..0.117 rows=153 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
55. 0.062 0.062 ↑ 1.5 153 1

CTE Scan on team_mbrs tm_ma (cost=0.00..4.44 rows=222 width=16) (actual time=0.001..0.062 rows=153 loops=1)

56. 0.044 0.082 ↓ 1.0 121 1

Hash (cost=2.34..2.34 rows=117 width=72) (actual time=0.082..0.082 rows=121 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
57. 0.038 0.038 ↓ 1.0 121 1

CTE Scan on peoples p_ma (cost=0.00..2.34 rows=117 width=72) (actual time=0.002..0.038 rows=121 loops=1)

58.          

CTE ltv_dti

59. 56.884 1,699.122 ↓ 35.8 42,999 1

Subquery Scan on a (cost=59,631.23..68,048.21 rows=1,202 width=28) (actual time=1,354.616..1,699.122 rows=42,999 loops=1)

  • Filter: (a.rn = 1)
  • Rows Removed by Filter: 200,001
60. 208.367 1,642.238 ↓ 1.0 243,000 1

WindowAgg (cost=59,631.23..65,042.15 rows=240,485 width=36) (actual time=1,354.598..1,642.238 rows=243,000 loops=1)

61. 402.230 1,433.871 ↓ 1.0 243,000 1

Sort (cost=59,631.23..60,232.45 rows=240,485 width=28) (actual time=1,354.584..1,433.871 rows=243,000 loops=1)

  • Sort Key: loan_tolerance_snapshot_items.loan_application_id, loan_tolerance_snapshot_items.tolerance_property_id, loan_tolerance_snapshot_items.last_updated_date DESC
  • Sort Method: external merge Disk: 9,440kB
62. 1,031.641 1,031.641 ↓ 1.0 243,000 1

Seq Scan on loan_tolerance_snapshot_items (cost=0.00..38,137.18 rows=240,485 width=28) (actual time=0.033..1,031.641 rows=243,000 loops=1)

  • Filter: (tolerance_property_id = ANY ('{4,17,18}'::integer[]))
  • Rows Removed by Filter: 2,052,189
63.          

CTE mi

64. 14.443 27.357 ↓ 1.0 9,620 1

WindowAgg (cost=793.60..1,129.60 rows=9,600 width=56) (actual time=9.899..27.357 rows=9,620 loops=1)

65. 7.974 12.914 ↓ 1.0 9,620 1

Sort (cost=793.60..817.60 rows=9,600 width=20) (actual time=9.851..12.914 rows=9,620 loops=1)

  • Sort Key: mortgage_insurances.loan_application_id, mortgage_insurances.last_updated_date DESC
  • Sort Method: quicksort Memory: 975kB
66. 4.940 4.940 ↓ 1.0 9,620 1

Seq Scan on mortgage_insurances (cost=0.00..158.62 rows=9,600 width=20) (actual time=0.036..4.940 rows=9,620 loops=1)

  • Filter: (NOT is_removed)
  • Rows Removed by Filter: 1,862
67.          

CTE deal_id

68. 63.926 95.620 ↓ 1.0 21,992 1

GroupAggregate (cost=0.29..1,758.93 rows=21,958 width=16) (actual time=0.029..95.620 rows=21,992 loops=1)

  • Group Key: affiliated_business_details.loan_application_id
69. 31.694 31.694 ↓ 1.0 43,983 1

Index Scan using affiliated_business_details_loan_and_business_idx on affiliated_business_details (cost=0.29..770.83 rows=43,915 width=21) (actual time=0.011..31.694 rows=43,983 loops=1)

70. 1.617 2,210.221 ↑ 1.6 368 1

Sort (cost=3,253.33..3,254.80 rows=589 width=2,031) (actual time=2,210.145..2,210.221 rows=368 loops=1)

  • Sort Key: addr.state_code, la.id, b.last_name, (((b.last_name || ', '::text) || b.first_name)), lad.submitted_1003_local_date, ((LEAST((lad.preapproval_local_date)::timestamp without time zone, (lad.fast_preapproval_local_date)::timestamp without time zone, ca.created_instant))::date), lad.application_received_local_date, (CASE WHEN (lad.rate_lock_cancelled_local_date IS NULL) THEN lad.rate_lock_local_date ELSE NULL::date END), lad.closing_local_date, (CASE WHEN (cl.created_instant IS NOT NULL) THEN 1 ELSE 0 END), (CASE WHEN ((lad.closing_local_date IS NOT NULL) AND (lad.application_received_local_date IS NOT NULL) AND (lo.id <> ALL ('{2,31,41,13,33,12,30,23,1,999,42,14,21,22,19,18,20,5,43,3,27,29,28}'::bigint[]))) THEN 1 ELSE 0 END), ltv.value_on_creation, top_dti.value_on_creation, bottom_dti.value_on_creation, lt.amount, lt.interest_rate, (COALESCE((di.deal_id)::bigint, la.deal_id)), lo.name, t.processor, t.underwriter, t.quality_reviewer, t.received, t.closer, t.secondary, t.mortgage_adviser, lo.is_closed_deal, (CASE WHEN (pri.project_type = 2) THEN 'Condo'::text WHEN (pri.num_units > 1) THEN 'Multi-Fam'::text WHEN (pri.num_units = 1) THEN 'SFR'::text ELSE 'Other'::text END), (CASE lt.product_type_id WHEN 1 THEN '30 Yr Fixed'::text WHEN 2 THEN '15 Yr Fixed'::text WHEN 3 THEN '5/1 ARM'::text WHEN 4 THEN '7/1 ARM'::text WHEN 5 THEN '10/1 ARM'::text WHEN 6 THEN '20 Yr Fixed'::text WHEN 7 THEN '25 Yr Fixed'::text WHEN 8 THEN '10 Yr Fixed'::text WHEN 9 THEN '3/1 ARM'::text ELSE NULL::text END), mi.mi_company, (CASE WHEN (COALESCE((di.deal_id)::bigint, la.deal_id) IS NOT NULL) THEN 'Y'::text ELSE 'N'::text END)
  • Sort Method: quicksort Memory: 134kB
71. 2.445 2,208.604 ↑ 1.6 368 1

Nested Loop Left Join (cost=1,884.85..3,226.23 rows=589 width=2,031) (actual time=2,038.121..2,208.604 rows=368 loops=1)

72. 0.551 2,203.951 ↑ 1.6 368 1

Hash Left Join (cost=1,884.56..2,994.52 rows=589 width=1,931) (actual time=2,038.046..2,203.951 rows=368 loops=1)

  • Hash Cond: (la.id = mi.loan_application_id)
73. 0.647 2,164.926 ↑ 1.6 368 1

Hash Left Join (cost=1,667.96..2,772.75 rows=589 width=1,899) (actual time=1,999.535..2,164.926 rows=368 loops=1)

  • Hash Cond: (la.id = bottom_dti.loan_application_id)
74. 0.552 2,146.181 ↑ 1.6 368 1

Hash Left Join (cost=1,640.84..2,743.42 rows=589 width=1,383) (actual time=1,981.396..2,146.181 rows=368 loops=1)

  • Hash Cond: (la.id = top_dti.loan_application_id)
75. 0.661 2,126.357 ↑ 1.6 368 1

Hash Left Join (cost=1,613.72..2,714.08 rows=589 width=867) (actual time=1,962.084..2,126.357 rows=368 loops=1)

  • Hash Cond: (la.id = ltv.loan_application_id)
76. 0.394 392.182 ↑ 1.6 368 1

Nested Loop Left Join (cost=1,586.60..2,684.74 rows=589 width=351) (actual time=228.523..392.182 rows=368 loops=1)

  • Join Filter: (NOT pri.is_removed)
77. 0.341 389.212 ↑ 1.6 368 1

Nested Loop Left Join (cost=1,586.31..2,490.34 rows=589 width=365) (actual time=228.505..389.212 rows=368 loops=1)

78. 0.697 386.295 ↑ 1.6 368 1

Nested Loop Left Join (cost=1,586.02..2,303.30 rows=589 width=342) (actual time=228.489..386.295 rows=368 loops=1)

79. 7.586 382.654 ↑ 1.6 368 1

Hash Right Join (cost=1,585.73..2,114.43 rows=589 width=337) (actual time=228.466..382.654 rows=368 loops=1)

  • Hash Cond: (t.loan_id = la.id)
80. 193.887 193.887 ↑ 1.0 22,012 1

CTE Scan on team t (cost=0.00..440.26 rows=22,013 width=232) (actual time=2.292..193.887 rows=22,012 loops=1)

81. 0.427 181.181 ↑ 1.6 368 1

Hash (cost=1,578.38..1,578.38 rows=588 width=113) (actual time=181.180..181.181 rows=368 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 51kB
82. 0.579 180.754 ↑ 1.6 368 1

Hash Left Join (cost=1,043.64..1,578.38 rows=588 width=113) (actual time=85.131..180.754 rows=368 loops=1)

  • Hash Cond: (la.id = ca.loan_application_id)
83. 0.398 177.472 ↑ 1.6 368 1

Hash Left Join (cost=910.68..1,441.74 rows=588 width=105) (actual time=82.397..177.472 rows=368 loops=1)

  • Hash Cond: (la.id = cl.loan_application_id)
84. 7.661 132.982 ↑ 1.6 368 1

Hash Right Join (cost=777.73..1,305.10 rows=588 width=97) (actual time=38.285..132.982 rows=368 loops=1)

  • Hash Cond: (di.loan_application_id = la.id)
85. 109.347 109.347 ↓ 1.0 21,992 1

CTE Scan on deal_id di (cost=0.00..439.16 rows=21,958 width=12) (actual time=0.031..109.347 rows=21,992 loops=1)

86. 0.368 15.974 ↑ 1.6 368 1

Hash (cost=770.38..770.38 rows=588 width=93) (actual time=15.974..15.974 rows=368 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 46kB
87. 0.626 15.606 ↑ 1.6 368 1

Hash Join (cost=1.24..770.38 rows=588 width=93) (actual time=0.297..15.606 rows=368 loops=1)

  • Hash Cond: (la.loan_status_id = lo.id)
88. 1.619 14.936 ↓ 1.0 1,192 1

Nested Loop (cost=0.29..759.14 rows=1,175 width=60) (actual time=0.154..14.936 rows=1,192 loops=1)

89. 8.529 8.529 ↑ 1.0 1,197 1

Seq Scan on loan_application_dates lad (cost=0.00..315.66 rows=1,199 width=36) (actual time=0.138..8.529 rows=1,197 loops=1)

  • Filter: ((application_received_local_date IS NOT NULL) AND (closing_local_date >= (('now'::cstring)::date - 90)))
  • Rows Removed by Filter: 12,331
90. 4.788 4.788 ↑ 1.0 1 1,197

Index Scan using loan_applications_pkey on loan_applications la (cost=0.29..0.36 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=1,197)

  • Index Cond: (id = lad.loan_application_id)
  • Filter: ((NOT is_test) AND (NOT is_removed))
  • Rows Removed by Filter: 0
91. 0.018 0.044 ↓ 1.5 34 1

Hash (cost=0.66..0.66 rows=23 width=41) (actual time=0.044..0.044 rows=34 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
92. 0.026 0.026 ↓ 1.5 34 1

Seq Scan on loan_status lo (cost=0.00..0.66 rows=23 width=41) (actual time=0.012..0.026 rows=34 loops=1)

  • Filter: is_active
  • Rows Removed by Filter: 19
93. 1.180 44.092 ↓ 81.1 2,352 1

Hash (cost=132.59..132.59 rows=29 width=16) (actual time=44.092..44.092 rows=2,352 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 143kB
94. 42.912 42.912 ↓ 81.1 2,352 1

CTE Scan on transition_events cl (cost=0.00..132.59 rows=29 width=16) (actual time=28.130..42.912 rows=2,352 loops=1)

  • Filter: (to_status = 10)
  • Rows Removed by Filter: 3,227
95. 0.949 2.703 ↓ 111.3 3,227 1

Hash (cost=132.59..132.59 rows=29 width=16) (actual time=2.703..2.703 rows=3,227 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 184kB
96. 1.754 1.754 ↓ 111.3 3,227 1

CTE Scan on transition_events ca (cost=0.00..132.59 rows=29 width=16) (actual time=0.009..1.754 rows=3,227 loops=1)

  • Filter: (to_status = 7)
  • Rows Removed by Filter: 2,352
97. 2.944 2.944 ↑ 1.0 1 368

Index Scan using borrowers_pkey on borrowers b (cost=0.29..0.31 rows=1 width=21) (actual time=0.007..0.008 rows=1 loops=368)

  • Index Cond: (la.primary_borrower_id = id)
98. 2.576 2.576 ↑ 1.0 1 368

Index Scan using property_information_loan_application_idx on property_information pri (cost=0.29..0.31 rows=1 width=23) (actual time=0.006..0.007 rows=1 loops=368)

  • Index Cond: (loan_application_id = la.id)
  • Filter: (NOT is_removed)
99. 2.576 2.576 ↑ 1.0 1 368

Index Scan using addresses_pkey on addresses addr (cost=0.29..0.32 rows=1 width=19) (actual time=0.006..0.007 rows=1 loops=368)

  • Index Cond: (address_id = pri.address_id)
  • Filter: (loan_application_id = pri.loan_application_id)
100. 6.761 1,733.514 ↓ 2,388.8 14,333 1

Hash (cost=27.04..27.04 rows=6 width=524) (actual time=1,733.514..1,733.514 rows=14,333 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 799kB
101. 1,726.753 1,726.753 ↓ 2,388.8 14,333 1

CTE Scan on ltv_dti ltv (cost=0.00..27.04 rows=6 width=524) (actual time=1,354.630..1,726.753 rows=14,333 loops=1)

  • Filter: (tolerance_property_id = 4)
  • Rows Removed by Filter: 28,666
102. 5.727 19.272 ↓ 2,388.8 14,333 1

Hash (cost=27.04..27.04 rows=6 width=524) (actual time=19.272..19.272 rows=14,333 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 792kB
103. 13.545 13.545 ↓ 2,388.8 14,333 1

CTE Scan on ltv_dti top_dti (cost=0.00..27.04 rows=6 width=524) (actual time=0.007..13.545 rows=14,333 loops=1)

  • Filter: (tolerance_property_id = 17)
  • Rows Removed by Filter: 28,666
104. 5.378 18.098 ↓ 2,388.8 14,333 1

Hash (cost=27.04..27.04 rows=6 width=524) (actual time=18.098..18.098 rows=14,333 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 793kB
105. 12.720 12.720 ↓ 2,388.8 14,333 1

CTE Scan on ltv_dti bottom_dti (cost=0.00..27.04 rows=6 width=524) (actual time=0.009..12.720 rows=14,333 loops=1)

  • Filter: (tolerance_property_id = 18)
  • Rows Removed by Filter: 28,666
106. 4.010 38.474 ↓ 200.4 9,620 1

Hash (cost=216.00..216.00 rows=48 width=40) (actual time=38.474..38.474 rows=9,620 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 556kB
107. 34.464 34.464 ↓ 200.4 9,620 1

CTE Scan on mi (cost=0.00..216.00 rows=48 width=40) (actual time=9.908..34.464 rows=9,620 loops=1)

  • Filter: (rn = 1)
108. 2.208 2.208 ↑ 1.0 1 368

Index Scan using loan_terms_unique_per_loan on loan_terms lt (cost=0.29..0.31 rows=1 width=24) (actual time=0.005..0.006 rows=1 loops=368)

  • Index Cond: (la.id = loan_application_id)
Planning time : 17.051 ms
Execution time : 2,218.370 ms