From e8efd228c0ca23acb089c8ab5faccc5f767f9537 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 16 Sep 2020 14:33:20 +0200 Subject: [PATCH 1/4] Added indexes --- pandora_console/extras/mr/42.sql | 14 ++++++++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 10 +++++++++- pandora_console/pandoradb.sql | 11 +++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 pandora_console/extras/mr/42.sql diff --git a/pandora_console/extras/mr/42.sql b/pandora_console/extras/mr/42.sql new file mode 100644 index 0000000000..e785b6e655 --- /dev/null +++ b/pandora_console/extras/mr/42.sql @@ -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; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index a8e1deae9a..e0ce345c46 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -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` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 7121fb134c..b070c3b831 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -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` -- --------------------------------------------------------------------- From ed4ba271587cbb2e9202e063d0fa55412f224955 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 16 Sep 2020 17:11:19 +0200 Subject: [PATCH 2/4] Fixed index --- pandora_console/pandoradb.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index b070c3b831..13ce81e1d0 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3227,10 +3227,10 @@ 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; +ALTER TABLE tmetaconsole_event ADD INDEX `tme_timestamp_idx` (`timestamp`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_module_status_idx` (`module_status`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_criticity_idx` (`criticity`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_agent_name_idx` (`agent_name`); -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -3279,8 +3279,8 @@ 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; +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_estado_idx` (`estado`); +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_timestamp_idx` (`timestamp`); -- --------------------------------------------------------------------- -- Table `textension_translate_string` @@ -3369,8 +3369,8 @@ 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; +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_id_os_idx` (`id_os`); +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_server_name_idx` (`server_name`); -- --------------------------------------------------------------------- -- Table `ttransaction` From dbb1ec6b849187fbbd171870c47be3c45bf678af Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 16 Sep 2020 17:19:07 +0200 Subject: [PATCH 3/4] Too long name fix --- pandora_console/extras/mr/42.sql | 16 ++++++++-------- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 16 ++++++++-------- pandora_console/pandoradb.sql | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_console/extras/mr/42.sql b/pandora_console/extras/mr/42.sql index e785b6e655..7c1bf9e2dd 100644 --- a/pandora_console/extras/mr/42.sql +++ b/pandora_console/extras/mr/42.sql @@ -1,14 +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 `tme_timestamp_idx` ON tmetaconsole_event (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; +CREATE INDEX `tme_module_status_idx` ON tmetaconsole_event (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT; +CREATE INDEX `tme_criticity_idx` ON tmetaconsole_event (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT; +CREATE INDEX `tme_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 `tma_id_os_idx` ON tmetaconsole_agent (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT; +CREATE INDEX `tma_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; +CREATE INDEX `tmeh_estado_idx` ON tmetaconsole_event_history (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; +CREATE INDEX `tmeh_timestamp_idx` ON tmetaconsole_event_history (`estado`) ALGORITHM DEFAULT LOCK DEFAULT; COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index e0ce345c46..480b98a78f 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -978,10 +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; +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT; -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -1030,8 +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; +ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_estado_idx` (`estado`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; -- --------------------------------------------------------------------- -- Table `textension_translate_string` -- --------------------------------------------------------------------- @@ -1126,8 +1126,8 @@ ALTER TABLE `tmetaconsole_agent` ADD COLUMN `remote` tinyint(1) 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 `tmetaconsole_agent_id_os_idx` (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT, - ADD INDEX `tmetaconsole_agent_server_name_idx` (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT; + ADD INDEX `tma_id_os_idx` (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT, + ADD INDEX `tma_server_name_idx` (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT; -- --------------------------------------------------------------------- -- Table `ttransaction` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 13ce81e1d0..6ba2ab6614 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3227,10 +3227,10 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( -- Criticity: 5 - Minor -- Criticity: 6 - Major -ALTER TABLE tmetaconsole_event ADD INDEX `tme_timestamp_idx` (`timestamp`); -ALTER TABLE tmetaconsole_event ADD INDEX `tme_module_status_idx` (`module_status`); -ALTER TABLE tmetaconsole_event ADD INDEX `tme_criticity_idx` (`criticity`); -ALTER TABLE tmetaconsole_event ADD INDEX `tme_agent_name_idx` (`agent_name`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event ADD INDEX `tme_module_status_idx` (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event ADD INDEX `tme_criticity_idx` (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event ADD INDEX `tme_agent_name_idx` (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT; -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -3279,8 +3279,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` ( -- Criticity: 5 - Minor -- Criticity: 6 - Major -ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_estado_idx` (`estado`); -ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_timestamp_idx` (`timestamp`); +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_estado_idx` (`estado`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; -- --------------------------------------------------------------------- -- Table `textension_translate_string` @@ -3369,8 +3369,8 @@ 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; -ALTER TABLE tmetaconsole_agent ADD INDEX `tma_id_os_idx` (`id_os`); -ALTER TABLE tmetaconsole_agent ADD INDEX `tma_server_name_idx` (`server_name`); +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_id_os_idx` (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_server_name_idx` (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT; -- --------------------------------------------------------------------- -- Table `ttransaction` From da01f9abd51d9b413337a6bf06ca061bf7ab2186 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 16 Sep 2020 17:32:05 +0200 Subject: [PATCH 4/4] Fix alter index --- pandora_console/extras/mr/42.sql | 16 ++++++++-------- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 16 ++++++++-------- pandora_console/pandoradb.sql | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_console/extras/mr/42.sql b/pandora_console/extras/mr/42.sql index 7c1bf9e2dd..cd64173322 100644 --- a/pandora_console/extras/mr/42.sql +++ b/pandora_console/extras/mr/42.sql @@ -1,14 +1,14 @@ START TRANSACTION; -CREATE INDEX `tme_timestamp_idx` ON tmetaconsole_event (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; -CREATE INDEX `tme_module_status_idx` ON tmetaconsole_event (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT; -CREATE INDEX `tme_criticity_idx` ON tmetaconsole_event (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT; -CREATE INDEX `tme_agent_name_idx` ON tmetaconsole_event (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event ADD INDEX `tme_timestamp_idx` (`timestamp`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_module_status_idx` (`module_status`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_criticity_idx` (`criticity`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_agent_name_idx` (`agent_name`); -CREATE INDEX `tma_id_os_idx` ON tmetaconsole_agent (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT; -CREATE INDEX `tma_server_name_idx` ON tmetaconsole_agent (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_id_os_idx` (`id_os`); +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_server_name_idx` (`server_name`); -CREATE INDEX `tmeh_estado_idx` ON tmetaconsole_event_history (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; -CREATE INDEX `tmeh_timestamp_idx` ON tmetaconsole_event_history (`estado`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_estado_idx` (`estado`); +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_timestamp_idx` (`timestamp`); COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 480b98a78f..a11bb7493b 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -978,10 +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 `tme_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`); +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`); +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`); +ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`); -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -1030,8 +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 `tmeh_estado_idx` (`estado`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_estado_idx` (`estado`); +ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_timestamp_idx` (`timestamp`); -- --------------------------------------------------------------------- -- Table `textension_translate_string` -- --------------------------------------------------------------------- @@ -1126,8 +1126,8 @@ ALTER TABLE `tmetaconsole_agent` ADD COLUMN `remote` tinyint(1) 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 `tma_id_os_idx` (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT, - ADD INDEX `tma_server_name_idx` (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT; + ADD INDEX `tma_id_os_idx` (`id_os`), + ADD INDEX `tma_server_name_idx` (`server_name`); -- --------------------------------------------------------------------- -- Table `ttransaction` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 6ba2ab6614..13ce81e1d0 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3227,10 +3227,10 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( -- Criticity: 5 - Minor -- Criticity: 6 - Major -ALTER TABLE tmetaconsole_event ADD INDEX `tme_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE tmetaconsole_event ADD INDEX `tme_module_status_idx` (`module_status`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE tmetaconsole_event ADD INDEX `tme_criticity_idx` (`criticity`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE tmetaconsole_event ADD INDEX `tme_agent_name_idx` (`agent_name`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event ADD INDEX `tme_timestamp_idx` (`timestamp`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_module_status_idx` (`module_status`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_criticity_idx` (`criticity`); +ALTER TABLE tmetaconsole_event ADD INDEX `tme_agent_name_idx` (`agent_name`); -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -3279,8 +3279,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` ( -- Criticity: 5 - Minor -- Criticity: 6 - Major -ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_estado_idx` (`estado`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_timestamp_idx` (`timestamp`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_estado_idx` (`estado`); +ALTER TABLE tmetaconsole_event_history ADD INDEX `tmeh_timestamp_idx` (`timestamp`); -- --------------------------------------------------------------------- -- Table `textension_translate_string` @@ -3369,8 +3369,8 @@ 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; -ALTER TABLE tmetaconsole_agent ADD INDEX `tma_id_os_idx` (`id_os`) ALGORITHM DEFAULT LOCK DEFAULT; -ALTER TABLE tmetaconsole_agent ADD INDEX `tma_server_name_idx` (`server_name`) ALGORITHM DEFAULT LOCK DEFAULT; +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_id_os_idx` (`id_os`); +ALTER TABLE tmetaconsole_agent ADD INDEX `tma_server_name_idx` (`server_name`); -- --------------------------------------------------------------------- -- Table `ttransaction`