Skip to content

Commit 5e295ff

Browse files
committed
Fix for completed query performance
1 parent 55388f1 commit 5e295ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

database/src/pool/postgres.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ static MIGRATIONS: &[&str] = &[
410410
411411
CREATE INDEX error_artifact_idx ON error(aid);
412412
"#,
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 IF NOT EXISTS benchmark_request_completed_idx ON benchmark_request(completed_at);
417+
"#
413418
];
414419

415420
#[async_trait::async_trait]

0 commit comments

Comments
 (0)