[icinga-checkins] icinga.org: icinga2/master: Add missing index on statehistory table for DB IDO cleanup

git at icinga.org git at icinga.org
Wed Jul 6 12:17:51 CEST 2016


Module: icinga2
Branch: master
Commit: a0a5989181195be1e47d28d2a5fead8ed9e2dfe3
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=a0a5989181195be1e47d28d2a5fead8ed9e2dfe3

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Wed Jul  6 12:15:25 2016 +0200

Add missing index on statehistory table for DB IDO cleanup

fixes #12107

---

 lib/db_ido_mysql/schema/mysql.sql         |    3 +++
 lib/db_ido_mysql/schema/upgrade/2.5.0.sql |    5 +++++
 lib/db_ido_pgsql/schema/pgsql.sql         |    3 +++
 lib/db_ido_pgsql/schema/upgrade/2.5.0.sql |    5 +++++
 4 files changed, 16 insertions(+)

diff --git a/lib/db_ido_mysql/schema/mysql.sql b/lib/db_ido_mysql/schema/mysql.sql
index 4815473..61c6bd2 100644
--- a/lib/db_ido_mysql/schema/mysql.sql
+++ b/lib/db_ido_mysql/schema/mysql.sql
@@ -1662,6 +1662,9 @@ CREATE INDEX idx_zonestatus_object_id on icinga_zonestatus(zone_object_id);
 CREATE INDEX idx_zones_parent_object_id on icinga_zones(parent_zone_object_id);
 CREATE INDEX idx_zonestatus_parent_object_id on icinga_zonestatus(parent_zone_object_id);
 
+-- #12107
+CREATE INDEX idx_statehistory_cleanup on icinga_statehistory(instance_id, state_time);
+
 -- -----------------------------------------
 -- set dbversion
 -- -----------------------------------------
diff --git a/lib/db_ido_mysql/schema/upgrade/2.5.0.sql b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
index f4e5c3d..07ed960 100644
--- a/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
+++ b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
@@ -46,6 +46,11 @@ CREATE INDEX idx_zones_parent_object_id on icinga_zones(parent_zone_object_id);
 CREATE INDEX idx_zonestatus_parent_object_id on icinga_zonestatus(parent_zone_object_id);
 
 -- -----------------------------------------
+-- #12107
+-- -----------------------------------------
+CREATE INDEX idx_statehistory_cleanup on icinga_statehistory(instance_id, state_time);
+
+-- -----------------------------------------
 -- set dbversion
 -- -----------------------------------------
 INSERT INTO icinga_dbversion (name, version, create_time, modify_time) VALUES ('idoutils', '1.14.1', NOW(), NOW()) ON DUPLICATE KEY UPDATE version='1.14.1', modify_time=NOW();
diff --git a/lib/db_ido_pgsql/schema/pgsql.sql b/lib/db_ido_pgsql/schema/pgsql.sql
index c55d62e..1f524a0 100644
--- a/lib/db_ido_pgsql/schema/pgsql.sql
+++ b/lib/db_ido_pgsql/schema/pgsql.sql
@@ -1691,6 +1691,9 @@ CREATE INDEX idx_zonestatus_object_id on icinga_zonestatus(zone_object_id);
 CREATE INDEX idx_zones_parent_object_id on icinga_zones(parent_zone_object_id);
 CREATE INDEX idx_zonestatus_parent_object_id on icinga_zonestatus(parent_zone_object_id);
 
+-- #12107
+CREATE INDEX idx_statehistory_cleanup on icinga_statehistory(instance_id, state_time);
+
 -- -----------------------------------------
 -- set dbversion
 -- -----------------------------------------
diff --git a/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
index bdb1745..25e0bb9 100644
--- a/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
+++ b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
@@ -39,6 +39,11 @@ CREATE INDEX idx_zones_parent_object_id on icinga_zones(parent_zone_object_id);
 CREATE INDEX idx_zonestatus_parent_object_id on icinga_zonestatus(parent_zone_object_id);
 
 -- -----------------------------------------
+-- #12107
+-- -----------------------------------------
+CREATE INDEX idx_statehistory_cleanup on icinga_statehistory(instance_id, state_time);
+
+-- -----------------------------------------
 -- set dbversion
 -- -----------------------------------------
 



More information about the icinga-checkins mailing list