Skip to content

Commit 8ef3a65

Browse files
authored
Fixes #1464 Improve submission query speed with temp table (#1465)
1 parent 356561c commit 8ef3a65

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

config/cron_udp.hjson

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
''',
207207
"submission":
208208
'''
209+
create temporary table all_assign_sub as (
209210
with enrollment as
210211
(
211212
select
@@ -250,9 +251,7 @@
250251
where
251252
co.lms_int_id in %(course_ids)s
252253
and la.status = 'published'
253-
),
254-
all_assign_sub as
255-
(
254+
)
256255
select
257256
cast(submission_id as BIGINT) AS id,
258257
assignment_id AS assignment_id,
@@ -271,10 +270,9 @@
271270
submitted_at AS submitted_at,
272271
graded_at AS graded_date,
273272
grade_posted_local_date
274-
from
275-
submission
276-
order by assignment_id
277-
)
273+
from
274+
submission
275+
);
278276
select
279277
f.id::bigint,
280278
f.assignment_id::bigint assignment_id,

0 commit comments

Comments
 (0)