diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql new file mode 100644 index 0000000000..b5358f6254 --- /dev/null +++ b/pandora_console/extras/mr/62.sql @@ -0,0 +1,7 @@ +-- Active: 1653046769261@@172.16.0.2@3306@pandora +START TRANSACTION; + +CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); +CREATE INDEX idx_disabled ON talert_template_modules (disabled); + +COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e43aaa7646..530a0049ac 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -557,7 +557,8 @@ CREATE TABLE IF NOT EXISTS `talert_template_modules` ( FOREIGN KEY (`id_alert_template`) REFERENCES talert_templates(`id`) ON DELETE CASCADE ON UPDATE CASCADE, UNIQUE (`id_agent_module`, `id_alert_template`, `id_policy_alerts`), - INDEX force_execution (`force_execution`) + INDEX force_execution (`force_execution`), + INDEX idx_disabled (disabled) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- ----------------------------------------------------- @@ -719,7 +720,8 @@ CREATE TABLE IF NOT EXISTS `tevento` ( PRIMARY KEY (`id_evento`), KEY `idx_agente` (`id_agente`), KEY `idx_agentmodule` (`id_agentmodule`), - KEY `idx_utimestamp` USING BTREE (`utimestamp`) + KEY `idx_utimestamp` USING BTREE (`utimestamp`), + INDEX `agente_modulo_estado`(`estado`, `id_agentmodule`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- Criticity: 0 - Maintance (grey) -- Criticity: 1 - Informational (blue)