explain.depesz.com

A tool for finding a real cause for slow queries.

Result: yPAI

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 351.058 669.586 ↓ 0.0 0 1

Update on wt_student wts (cost=39,096.26..59,782.89 rows=1 width=825) (actual time=669.586..669.586 rows=0 loops=1)

2.          

CTE student_num_info

3. 60.098 60.098 ↑ 1.0 22,311 1

Index Scan using student_fk1 on student (cost=0.00..20,658.55 rows=22,562 width=16) (actual time=0.017..60.098 rows=22,311 loops=1)

  • Index Cond: (partner_id = 231)
  • Filter: ((student_number IS NOT NULL) AND (NOT is_deleted_yn))
4.          

CTE single_active

5. 35.199 106.026 ↓ 109.8 21,950 1

HashAggregate (cost=676.86..679.36 rows=200 width=226) (actual time=90.964..106.026 rows=21,950 loops=1)

  • Filter: (sum(student_num_info.active_indicator) = 1)
6. 70.827 70.827 ↑ 1.0 22,311 1

CTE Scan on student_num_info (cost=0.00..451.24 rows=22,562 width=226) (actual time=0.019..70.827 rows=22,311 loops=1)

7. 49.010 318.528 ↓ 12,785.0 12,785 1

Hash Join (cost=17,758.35..38,444.98 rows=1 width=825) (actual time=234.296..318.528 rows=12,785 loops=1)

  • Hash Cond: ((s.student_number)::text = (sa.student_number)::text)
8. 38.582 38.582 ↑ 1.0 22,007 1

Index Scan using student_fk1 on student s (cost=0.00..20,602.22 rows=22,508 width=23) (actual time=0.101..38.582 rows=22,007 loops=1)

  • Index Cond: (partner_id = 231)
  • Filter: ((NOT is_deleted_yn) AND ((profile_status_description)::text = 'ACTIVE'::text))
9. 13.525 230.936 ↓ 1,278.5 12,785 1

Hash (cost=17,758.23..17,758.23 rows=10 width=1,033) (actual time=230.936..230.936 rows=12,785 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2863kB
10. 24.928 217.411 ↓ 1,278.5 12,785 1

Hash Join (cost=17,728.63..17,758.23 rows=10 width=1,033) (actual time=164.540..217.411 rows=12,785 loops=1)

  • Hash Cond: ((sa.student_number)::text = (wts.student_id)::text)
11. 118.993 118.993 ↓ 109.8 21,950 1

CTE Scan on single_active sa (cost=0.00..4.00 rows=200 width=460) (actual time=90.990..118.993 rows=21,950 loops=1)

12. 12.839 73.490 ↑ 1.3 12,800 1

Hash (cost=17,514.89..17,514.89 rows=17,099 width=573) (actual time=73.490..73.490 rows=12,800 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 2217kB
13. 60.651 60.651 ↑ 1.3 12,800 1

Index Scan using wt_student_partner on wt_student wts (cost=0.00..17,514.89 rows=17,099 width=573) (actual time=0.123..60.651 rows=12,800 loops=1)

  • Index Cond: (partner_id = 231)
  • Filter: ((wt_potential_dups_status)::text = 'NO_DUPLICATES'::text)