DB IDO: Add an index for CV session delete

The DELETE statement might become painfully slow on
large installations.

refs #10436
This commit is contained in:
Michael Friedrich 2015-10-29 16:18:49 +01:00
parent 9485938d32
commit 4d784dd075
4 changed files with 14 additions and 0 deletions

View File

@ -1637,6 +1637,10 @@ CREATE INDEX sla_idx_obj ON icinga_objects (objecttype_id, is_active, name1);
-- #4985
CREATE INDEX commenthistory_delete_idx ON icinga_commenthistory (instance_id, comment_time, internal_comment_id);
-- #10436
CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token);
CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token);
-- -----------------------------------------
-- set dbversion
-- -----------------------------------------

View File

@ -55,6 +55,9 @@ ALTER TABLE icinga_hoststatus ADD COLUMN original_attributes TEXT character set
ALTER TABLE icinga_customvariables ADD COLUMN session_token varchar(512) character set latin1 default NULL;
ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token varchar(512) character set latin1 default NULL;
CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token);
CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token);
-- -----------------------------------------
-- update dbversion
-- -----------------------------------------

View File

@ -1666,6 +1666,10 @@ CREATE INDEX sla_idx_obj ON icinga_objects (objecttype_id, is_active, name1);
-- #4985
CREATE INDEX commenthistory_delete_idx ON icinga_commenthistory (instance_id, comment_time, internal_comment_id);
-- #10436
CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token);
CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token);
-- -----------------------------------------
-- set dbversion
-- -----------------------------------------

View File

@ -163,6 +163,9 @@ ALTER TABLE icinga_hoststatus ADD COLUMN original_attributes TEXT default NULL;
ALTER TABLE icinga_customvariables ADD COLUMN session_token TEXT default NULL;
ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token TEXT default NULL;
CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token);
CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token);
-- -----------------------------------------
-- update dbversion
-- -----------------------------------------