Tuning tip, may not be a blocker: If you sharpen the student_info check a bit more, I think you can get by with a simpler (no join) CampusData.is_previous_ugrad? check.

What you've got now will return ex-grad-students who aren't students anymore (like Bernie). But if you also do the standard person role check on "affiliations", you can restrict the "previous undergrad" check to "current grad students". And that would let you just do:

          select ts.student_ldap_uid from calcentral_transcript_vw ts
          where ts.line_type = 'U'
          and ts.student_ldap_uid = #{connection.quote(ldap_uid)}

instead of:

        select si.student_ldap_uid from calcentral_student_info_vw si
        join (
          select ts.student_ldap_uid from calcentral_transcript_vw ts
          where ts.line_type = 'U'
          and ts.student_ldap_uid = #{connection.quote(ldap_uid)}
        ) old_ug_uids on
        (old_ug_uids.student_ldap_uid = si.student_ldap_uid)
        where si.ug_grad_flag = 'G'
        and si.student_ldap_uid = #{connection.quote(ldap_uid)}