Skip to content

Commit f936848

Browse files
committed
add error.aid index
1 parent 5e295ff commit f936848

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

database/src/pool/postgres.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,13 @@ static MIGRATIONS: &[&str] = &[
414414
// of requests grows to make things fast we need an index on the completed_at
415415
r#"
416416
CREATE INDEX IF NOT EXISTS benchmark_request_completed_idx ON benchmark_request(completed_at);
417-
"#
417+
"#,
418+
// Artifacts table grows massively and we do a join on artifacts.id = error.aid.
419+
// Thus error.aid needs an index to filter errors for an artifact without
420+
// a full table scan
421+
r#"
422+
CREATE INDEX IF NOT EXISTS error_aid_idx ON error(aid);
423+
"#,
418424
];
419425

420426
#[async_trait::async_trait]

0 commit comments

Comments
 (0)