Skip to content

Commit c799d67

Browse files
committed
Fix for completed query performance
1 parent 60d24c9 commit c799d67

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
@@ -387,6 +387,11 @@ static MIGRATIONS: &[&str] = &[
387387
r#"
388388
ALTER TABLE collector_config ADD COLUMN commit_sha TEXT NULL;
389389
"#,
390+
// For completed requests we take the last N completed. As the total number
391+
// of requests grows to make things fast we need an index on the completed_at
392+
r#"
393+
CREATE INDEX IF NOT EXISTS benchmark_request_completed_idx ON benchmark_request(completed_at);
394+
"#
390395
];
391396

392397
#[async_trait::async_trait]

0 commit comments

Comments
 (0)