File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -410,6 +410,11 @@ static MIGRATIONS: &[&str] = &[
410
410
411
411
CREATE INDEX error_artifact_idx ON error(aid);
412
412
"# ,
413
+ // For completed requests we take the last N completed. As the total number
414
+ // of requests grows to make things fast we need an index on the completed_at
415
+ r#"
416
+ CREATE INDEX benchmark_request_completed_idx ON benchmark_request(completed_at);
417
+ "# ,
413
418
] ;
414
419
415
420
#[ async_trait:: async_trait]
@@ -743,10 +748,8 @@ impl PostgresConnection {
743
748
UNION
744
749
SELECT tag FROM parents
745
750
)
746
- SELECT job_queue.*
747
- FROM requests
748
- -- Only get requests that have some jobs
749
- RIGHT JOIN job_queue on job_queue.request_tag = requests.tag
751
+ -- Only get the jobs of in_progress requests
752
+ SELECT * FROM job_queue INNER JOIN requests ON job_queue.request_tag = requests.tag
750
753
" ) ) . await . unwrap ( ) ,
751
754
} ) ,
752
755
conn,
You can’t perform that action at this time.
0 commit comments