Changes between Version 3 and Version 4 of QueryOptimization


Ignore:
Timestamp:
07/01/26 18:13:18 (4 days ago)
Author:
231082
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • QueryOptimization

    v3 v4  
    9393RETURNS TABLE (...) LANGUAGE plpgsql STABLE AS $$
    9494BEGIN
    95 RETURN QUERY
    96 WITH active_pe AS (
    97 -- Only one row due to student_id filter pushed down
    98 SELECT pe.id AS pe_id, pe.academic_program_code
    99 FROM Program_Enrollment pe
    100 WHERE pe.student_id = p_student_id
    101 AND pe.date_disenrollment IS NULL
    102 AND pe.finished IS NOT TRUE
     95  RETURN QUERY
     96  WITH active_pe AS (
     97  -- Only one row due to student_id filter pushed down
     98  SELECT pe.id AS pe_id, pe.academic_program_code
     99  FROM Program_Enrollment pe
     100  WHERE pe.student_id = p_student_id
     101  AND pe.date_disenrollment IS NULL
     102  AND pe.finished IS NOT TRUE
    103103),
    104104-- All subsequent CTEs now operate on one student's data