"Merge Right Join (cost=202198.78..295729.10 rows=1 width=8) (actual time=1399.727..5224.574 rows=296 loops=1)" " Merge Cond: (ssd.aamc_id = s.aamc_id)" " Buffers: shared hit=628970, temp read=2092 written=2106" " -> Unique (cost=187052.73..188113.52 rows=141439 width=6) (actual time=1005.122..1206.142 rows=206307 loops=1)" " Buffers: shared hit=5687, temp read=2092 written=2106" " -> Sort (cost=187052.73..187406.32 rows=141439 width=6) (actual time=1005.121..1073.008 rows=276329 loops=1)" " Sort Key: ssd.aamc_id, rsr.is_allowed_ind" " Sort Method: external merge Disk: 4336kB" " Buffers: shared hit=5687, temp read=2092 written=2106" " -> Hash Join (cost=79817.99..173017.25 rows=141439 width=6) (actual time=384.889..931.901 rows=276332 loops=1)" " Hash Cond: (((ssd.enrollment_status_cd)::text = (rsr.enrollment_status_cd)::text) AND (((lag(ssd.enrollment_status_cd, 1) OVER (?)))::text = (rsr.next_status_cd)::text))" " Buffers: shared hit=5684, temp read=1550 written=1560" " -> WindowAgg (cost=79750.76..91788.12 rows=601868 width=43) (actual time=383.781..812.028 rows=601725 loops=1)" " Buffers: shared hit=5672, temp read=1550 written=1560" " -> Sort (cost=79750.76..81255.43 rows=601868 width=11) (actual time=383.764..492.718 rows=601725 loops=1)" " Sort Key: ssd.aamc_id, ssd.status_effective_dt DESC" " Sort Method: external merge Disk: 12400kB" " Buffers: shared hit=5672, temp read=1550 written=1560" " -> Seq Scan on student_status_detail ssd (cost=0.00..11687.68 rows=601868 width=11) (actual time=0.021..145.945 rows=601725 loops=1)" " Buffers: shared hit=5669" " -> Hash (cost=34.09..34.09 rows=2209 width=8) (actual time=1.074..1.075 rows=2209 loops=1)" " Buckets: 4096 Batches: 1 Memory Usage: 119kB" " Buffers: shared hit=12" " -> Seq Scan on ref_status_rule rsr (cost=0.00..34.09 rows=2209 width=8) (actual time=0.027..0.683 rows=2209 loops=1)" " Buffers: shared hit=12" " -> Materialize (cost=15146.05..105847.58 rows=1 width=12) (actual time=392.551..3994.498 rows=296 loops=1)" " Buffers: shared hit=623283" " -> Nested Loop (cost=15146.05..105847.57 rows=1 width=12) (actual time=392.546..3993.909 rows=294 loops=1)" " Buffers: shared hit=623283" " -> Nested Loop (cost=15145.91..105847.41 rows=1 width=17) (actual time=392.507..3991.089 rows=294 loops=1)" " Buffers: shared hit=622695" " -> Nested Loop (cost=15145.76..105847.24 rows=1 width=19) (actual time=392.458..3988.371 rows=294 loops=1)" " Buffers: shared hit=622107" " -> Gather Merge (cost=15145.62..105847.08 rows=1 width=20) (actual time=392.414..3974.635 rows=300 loops=1)" " Workers Planned: 2" " Workers Launched: 2" " Buffers: shared hit=621507" " -> Nested Loop (cost=14145.60..104846.94 rows=1 width=20) (actual time=346.402..3741.265 rows=100 loops=3)" " Join Filter: (((max(student_status_detail.status_effective_dt)) = s.status_effective_dt) AND ((max(student_status_detail.last_updated_ts)) = s.last_updated_ts))" " Rows Removed by Join Filter: 75" " Buffers: shared hit=621507" " -> Merge Join (cost=14145.17..104789.57 rows=1 width=32) (actual time=346.302..3674.516 rows=100 loops=3)" " Merge Cond: (p.aamc_id = student_class_detail.aamc_id)" " Buffers: shared hit=608091" " -> Sort (cost=14144.74..14145.12 rows=150 width=28) (actual time=207.944..208.045 rows=103 loops=3)" " Sort Key: p.aamc_id" " Sort Method: quicksort Memory: 39kB" " Worker 0: Sort Method: quicksort Memory: 31kB" " Worker 1: Sort Method: quicksort Memory: 27kB" " Buffers: shared hit=9062" " -> Nested Loop (cost=1182.45..14139.32 rows=150 width=28) (actual time=7.876..207.827 rows=103 loops=3)" " Join Filter: (student_status_detail.aamc_id = p.aamc_id)" " Buffers: shared hit=9054" " -> Hash Join (cost=1182.03..14057.72 rows=151 width=22) (actual time=7.799..205.854 rows=103 loops=3)" " Hash Cond: (sdp.aamc_id = student_status_detail.aamc_id)" " Buffers: shared hit=7816" " -> Parallel Seq Scan on student_degree_program sdp (cost=0.00..12485.39 rows=148688 width=6) (actual time=0.037..172.403 rows=119754 loops=3)" " Filter: ((degree_program_type_cd)::text = '2'::text)" " Rows Removed by Filter: 239438" " Buffers: shared hit=6872" " -> Hash (cost=1177.50..1177.50 rows=362 width=16) (actual time=3.757..3.760 rows=309 loops=3)" " Buckets: 1024 Batches: 1 Memory Usage: 23kB" " Buffers: shared hit=944" " -> HashAggregate (cost=1170.26..1173.88 rows=362 width=16) (actual time=3.601..3.676 rows=309 loops=3)" " Group Key: student_status_detail.aamc_id" " Buffers: shared hit=944" " -> Bitmap Heap Scan on student_status_detail (cost=20.14..1167.55 rows=362 width=16) (actual time=0.217..3.436 rows=317 loops=3)" " Recheck Cond: ((institution_id = 159) AND ((academic_year)::text = '2001'::text))" " Heap Blocks: exact=308" " Buffers: shared hit=944" " -> Bitmap Index Scan on uk_student_status_detail_institutionid_academicyear_aamcid_enro (cost=0.00..20.05 rows=362 width=0) (actual time=0.146..0.146 rows=317 loops=3)" " Index Cond: ((institution_id = 159) AND ((academic_year)::text = '2001'::text))" " Buffers: shared hit=20" " -> Index Scan using pk_person on person p (cost=0.42..0.53 rows=1 width=6) (actual time=0.017..0.017 rows=1 loops=309)" " Index Cond: (aamc_id = sdp.aamc_id)" " Filter: ((record_deleted_ind)::text = 'N'::text)" " Buffers: shared hit=1238" " -> GroupAggregate (cost=0.43..90621.27 rows=1824 width=72) (actual time=0.103..3412.067 rows=285793 loops=3)" " Group Key: student_class_detail.aamc_id" " Filter: (max((student_class_detail.class_level_cd)::text) = '4'::text)" " Rows Removed by Filter: 72736" " Buffers: shared hit=599029" " -> Index Scan using uk_student_class_detail_aamcid_classlevelcd on student_class_detail (cost=0.43..79612.10 rows=1289905 width=6) (actual time=0.076..2586.756 rows=1281478 loops=3)" " Filter: (class_level_start_dt IS NOT NULL)" " Rows Removed by Filter: 152040" " Buffers: shared hit=599029" " -> Index Scan using uk_student_status_detail_institutionid_academicyear_aamcid_enro on student_status_detail s (cost=0.42..57.35 rows=1 width=28) (actual time=0.109..0.659 rows=2 loops=300)" " Index Cond: ((institution_id = 159) AND (aamc_id = p.aamc_id))" " Buffers: shared hit=13416" " -> Index Scan using pk_ref_enrollment_status on ref_enrollment_status res (cost=0.14..0.16 rows=1 width=5) (actual time=0.006..0.006 rows=1 loops=300)" " Index Cond: ((enrollment_status_cd)::text = (s.enrollment_status_cd)::text)" " Filter: ((active_ind)::text = ANY ('{Y,N}'::text[]))" " Rows Removed by Filter: 0" " Buffers: shared hit=600" " -> Index Only Scan using pk_ref_medical_program_type on ref_medical_program_type rmpt (cost=0.14..0.16 rows=1 width=78) (actual time=0.005..0.005 rows=1 loops=294)" " Index Cond: (medical_program_type_cd = (sdp.medical_program_type_cd)::text)" " Heap Fetches: 294" " Buffers: shared hit=588" " -> Index Only Scan using pk_ref_academic_year on ref_academic_year a (cost=0.14..0.17 rows=1 width=78) (actual time=0.005..0.005 rows=1 loops=294)" " Index Cond: (academic_year = (s.academic_year)::text)" " Heap Fetches: 294" " Buffers: shared hit=588" "Planning Time: 10.344 ms" "Execution Time: 5228.314 ms"