Skip to content

Commit

Permalink
Fixes #1464 Improve submission query speed with temp table (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonespm committed Dec 19, 2022
1 parent 356561c commit 8ef3a65
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions config/cron_udp.hjson
Expand Up @@ -206,6 +206,7 @@
''',
"submission":
'''
create temporary table all_assign_sub as (
with enrollment as
(
select
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 8ef3a65

Please sign in to comment.