Skip to content

Commit

Permalink
schema: add index on deployment log startup time
Browse files Browse the repository at this point in the history
fixes #2551
  • Loading branch information
Thomas-Gelf committed Jun 20, 2022
1 parent 31c06d8 commit 411733a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions schema/mysql-migrations/upgrade_179.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE director_deployment_log ADD INDEX (start_time);

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES ('179', NOW());
3 changes: 2 additions & 1 deletion schema/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ CREATE TABLE director_deployment_log (
username VARCHAR(64) DEFAULT NULL COMMENT 'The user that triggered this deployment',
startup_log MEDIUMTEXT DEFAULT NULL,
PRIMARY KEY (id),
INDEX (start_time),
CONSTRAINT config_checksum
FOREIGN KEY config_checksum (config_checksum)
REFERENCES director_generated_config (checksum)
Expand Down Expand Up @@ -2414,4 +2415,4 @@ CREATE TABLE branched_icinga_dependency (

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (178, NOW());
VALUES (179, NOW());
5 changes: 5 additions & 0 deletions schema/pgsql-migrations/upgrade_179.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE INDEX start_time_idx ON director_deployment_log (start_time);

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (179, NOW());
4 changes: 3 additions & 1 deletion schema/pgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ COMMENT ON COLUMN director_deployment_log.duration_connection IS 'The time it to
COMMENT ON COLUMN director_deployment_log.duration_dump IS 'Time spent dumping the config (ms)';
COMMENT ON COLUMN director_deployment_log.username IS 'The user that triggered this deployment';

CREATE INDEX start_time_idx ON director_deployment_log (start_time);


CREATE TABLE director_datalist (
id serial,
Expand Down Expand Up @@ -2747,4 +2749,4 @@ CREATE INDEX branched_dependency_search_object_name ON branched_icinga_dependenc

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (178, NOW());
VALUES (179, NOW());

0 comments on commit 411733a

Please sign in to comment.