Added indexes

This commit is contained in:
Jose Gonzalez 2020-09-16 14:33:20 +02:00
parent cbed2ef758
commit e8efd228c0
3 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,14 @@
START TRANSACTION;
CREATE INDEX `tmetaconsole_event_timestamp_idx` ON tmetaconsole_event (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_module_status_idx` ON tmetaconsole_event (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_criticity_idx` ON tmetaconsole_event (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_agent_name_idx` ON tmetaconsole_event (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_agent_id_os_idx` ON tmetaconsole_agent (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_agent_server_name_idx` ON tmetaconsole_agent (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_history_timestamp_idx` ON tmetaconsole_event_history (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_history_estado_idx` ON tmetaconsole_event_history (`estado`) ALGORITHM DEFAULT LOCK DEFAULT;
COMMIT;

View File

@ -978,6 +978,10 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tmetaconsole_event_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT;
ALTER TABLE `tmetaconsole_event` ADD INDEX `tmetaconsole_event_module_status_idx` (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT;
ALTER TABLE `tmetaconsole_event` ADD INDEX `tmetaconsole_event_criticity_idx` (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT;
ALTER TABLE `tmetaconsole_event` ADD INDEX `tmetaconsole_event_agent_name_idx` (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT;
-- ---------------------------------------------------------------------
-- Table `tmetaconsole_event_history`
@ -1026,6 +1030,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` (
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmetaconsole_event_history_estado_idx` (`estado`) ALGORITHM DEFAULT LOCK DEFAULT;
ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmetaconsole_event_history_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT;
-- ---------------------------------------------------------------------
-- Table `textension_translate_string`
-- ---------------------------------------------------------------------
@ -1119,7 +1125,9 @@ ALTER TABLE `tmetaconsole_agent` ADD COLUMN `remote` tinyint(1) NOT NULL DEFAULT
ADD COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0',
MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0',
ADD INDEX `id_tagente_idx` (`id_tagente`);
ADD INDEX `id_tagente_idx` (`id_tagente`),
ADD INDEX `tmetaconsole_agent_id_os_idx` (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT,
ADD INDEX `tmetaconsole_agent_server_name_idx` (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT;
-- ---------------------------------------------------------------------
-- Table `ttransaction`

View File

@ -3227,6 +3227,11 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
-- Criticity: 5 - Minor
-- Criticity: 6 - Major
CREATE INDEX `tmetaconsole_event_timestamp_idx` ON tmetaconsole_event (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_module_status_idx` ON tmetaconsole_event (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_criticity_idx` ON tmetaconsole_event (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_agent_name_idx` ON tmetaconsole_event (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT;
-- ---------------------------------------------------------------------
-- Table `tmetaconsole_event_history`
-- ---------------------------------------------------------------------
@ -3274,6 +3279,9 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` (
-- Criticity: 5 - Minor
-- Criticity: 6 - Major
CREATE INDEX `tmetaconsole_event_history_estado_idx` ON tmetaconsole_event_history (`estado`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_event_history_timestamp_idx` ON tmetaconsole_event_history (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT;
-- ---------------------------------------------------------------------
-- Table `textension_translate_string`
-- ---------------------------------------------------------------------
@ -3361,6 +3369,9 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `tmetaconsole_agent_id_os_idx` ON tmetaconsole_agent (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT;
CREATE INDEX `tmetaconsole_agent_server_name_idx` ON tmetaconsole_agent (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT;
-- ---------------------------------------------------------------------
-- Table `ttransaction`
-- ---------------------------------------------------------------------