Skip to content

Commit 6a6dadb

Browse files
committed
add error.aid index
1 parent c799d67 commit 6a6dadb

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
@@ -391,7 +391,13 @@ static MIGRATIONS: &[&str] = &[
391391
// of requests grows to make things fast we need an index on the completed_at
392392
r#"
393393
CREATE INDEX IF NOT EXISTS benchmark_request_completed_idx ON benchmark_request(completed_at);
394-
"#
394+
"#,
395+
// Artifacts table grows massively and we do a join on artifacts.id = error.aid.
396+
// Thus error.aid needs an index to filter errors for an artifact without
397+
// a full table scan
398+
r#"
399+
CREATE INDEX IF NOT EXISTS error_aid_idx ON error(aid);
400+
"#,
395401
];
396402

397403
#[async_trait::async_trait]

0 commit comments

Comments
 (0)