From 8ef3a6566fcfed1d33f18d45eb709f6942851525 Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Mon, 19 Dec 2022 15:56:42 -0500 Subject: [PATCH] Fixes #1464 Improve submission query speed with temp table (#1465) --- config/cron_udp.hjson | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/config/cron_udp.hjson b/config/cron_udp.hjson index 0a8facf2..3a27ccee 100644 --- a/config/cron_udp.hjson +++ b/config/cron_udp.hjson @@ -206,6 +206,7 @@ ''', "submission": ''' + create temporary table all_assign_sub as ( with enrollment as ( select @@ -250,9 +251,7 @@ where co.lms_int_id in %(course_ids)s and la.status = 'published' - ), - all_assign_sub as - ( + ) select cast(submission_id as BIGINT) AS id, assignment_id AS assignment_id, @@ -271,10 +270,9 @@ submitted_at AS submitted_at, graded_at AS graded_date, grade_posted_local_date - from - submission - order by assignment_id - ) + from + submission + ); select f.id::bigint, f.assignment_id::bigint assignment_id,