diff --git a/lib/db_ido_mysql/schema/mysql.sql b/lib/db_ido_mysql/schema/mysql.sql index 481547324..61c6bd269 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 f4e5c3d96..07ed960ce 100644 --- a/lib/db_ido_mysql/schema/upgrade/2.5.0.sql +++ b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql @@ -45,6 +45,11 @@ 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/pgsql.sql b/lib/db_ido_pgsql/schema/pgsql.sql index c55d62e7b..1f524a0df 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 bdb174572..25e0bb968 100644 --- a/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql +++ b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql @@ -38,6 +38,11 @@ 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 -- -----------------------------------------