From bf28bad8d42664c9ecea09947f90ca6dd0aa049a Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 8 Aug 2011 15:18:07 +0000 Subject: [PATCH] 2011-08-08 Ramon Novoa * pandoradb.sql, extras/pandoradb_migrate_v3.2_to_v4.0.sql: Added a few more indexes suggested by Manuel Arostegui. Thanks a lot! git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4682 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ .../extras/pandoradb_migrate_v3.2_to_v4.0.sql | 8 +++++++- pandora_console/pandoradb.sql | 9 ++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a4578f8f43..a061d990c9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-08-08 Ramon Novoa + + * pandoradb.sql, extras/pandoradb_migrate_v3.2_to_v4.0.sql: Added a + few more indexes suggested by Manuel Arostegui. Thanks a lot! + 2011-08-08 Ramon Novoa * pandoradb.sql, extras/pandoradb_migrate_v3.2_to_v4.0.sql: Added an diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql index 18f00e87c7..4a4de416f3 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql @@ -106,6 +106,7 @@ ALTER TABLE tusuario_perfil ADD `id_policy` int(10) unsigned NOT NULL default 0; -- ----------------------------------------------------- ALTER TABLE `tevento` MODIFY `event_type` enum('unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change') default 'unknown'; +ALTER TABLE tevento ADD INDEX criticity (`criticity`); -- ----------------------------------------------------- -- Change the value "0000-00-00 00:00:00" that Pandora use as zero or null date value @@ -178,7 +179,7 @@ ALTER TABLE `tagente_modulo` ADD COLUMN (`unit` text DEFAULT ''); ALTER TABLE `tagente_modulo` ADD COLUMN (`str_warning` text DEFAULT ''); ALTER TABLE `tagente_modulo` ADD COLUMN (`str_critical` text DEFAULT ''); ALTER TABLE `tagente_modulo` ADD INDEX module (`id_modulo`); -ALTER TABLE `tagente_modulo` ADD INDEX nombre (`nombre`); +ALTER TABLE `tagente_modulo` ADD INDEX nombre (`nombre` (255)); -- ----------------------------------------------------- -- Table `tevento` @@ -228,3 +229,8 @@ ALTER TABLE talert_template_modules ADD INDEX force_execution (`force_execution` -- ----------------------------------------------------- ALTER TABLE tserver_export ADD INDEX id_export_server (`id_export_server`); +-- ----------------------------------------------------- +-- Table `ttrap` +-- ----------------------------------------------------- +ALTER TABLE ttrap ADD INDEX timestamp (`timestamp`); +ALTER TABLE ttrap ADD INDEX status (`status`); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index c4a7612e55..ae13718671 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -192,7 +192,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( KEY `id_tipo_modulo` (`id_tipo_modulo`), KEY `disabled` (`disabled`), KEY `module` (`id_modulo`), - KEY `nombre` (`nombre`) + KEY `nombre` (`nombre` (255)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- snmp_oid is also used for WMI query @@ -429,7 +429,8 @@ CREATE TABLE IF NOT EXISTS `tevento` ( PRIMARY KEY (`id_evento`), KEY `indice_1` (`id_agente`,`id_evento`), KEY `indice_2` (`utimestamp`,`id_evento`), - KEY `idx_agentmodule` (`id_agentmodule`) + KEY `idx_agentmodule` (`id_agentmodule`), + INDEX criticity (`criticity`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Criticity: 0 - Maintance (grey) @@ -723,7 +724,9 @@ CREATE TABLE IF NOT EXISTS `ttrap` ( `text` varchar(255) default '', `description` varchar(255) default '', `severity` tinyint(4) unsigned NOT NULL default '2', - PRIMARY KEY (`id_trap`) + PRIMARY KEY (`id_trap`), + INDEX timestamp (`timestamp`), + INDEX status (`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `tusuario` (