diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 459305df..26617789 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -609,6 +609,7 @@ create table RunCommandLogs ( -- core_dumped must not be null. However, these semantics are tricky -- to encode as constraints and probably provide limited actual value. ); +create index IndexRunCommandLogsOnBuildID on RunCommandLogs(build_id); -- The output paths that have permanently failed. create table FailedPaths ( diff --git a/src/sql/upgrade-81.sql b/src/sql/upgrade-81.sql index 8e6adc43..d7dcb519 100644 --- a/src/sql/upgrade-81.sql +++ b/src/sql/upgrade-81.sql @@ -2,3 +2,4 @@ alter table runcommandlogs add column uuid uuid; update runcommandlogs set uuid = gen_random_uuid() where uuid is null; alter table runcommandlogs alter column uuid set not null; alter table runcommandlogs add constraint RunCommandLogs_uuid_unique unique(uuid); +create index IndexRunCommandLogsOnBuildID on RunCommandLogs(build_id);