From 535051e77fb5b7d0e44c65202ed8f1d5d39fffc4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Jul 2012 09:24:51 +0000 Subject: [PATCH] Some index to speed up access/update of huge history-logs --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_current.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 328efc992b..caf363b4ce 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -12,7 +12,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'EGroupware API'; -$setup_info['phpgwapi']['version'] = '1.9.017'; +$setup_info['phpgwapi']['version'] = '1.9.018'; $setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index fb4a860135..667e449bd8 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -229,7 +229,7 @@ $phpgw_baseline = array( ), 'pk' => array('history_id'), 'fk' => array(), - 'ix' => array(array('history_appname','history_record_id','history_status','history_timestamp')), + 'ix' => array(array('history_appname','history_record_id','history_id')), 'uc' => array() ), 'egw_async' => array( diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index cfae6a64ac..1b20828f0d 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -444,3 +444,18 @@ function phpgwapi_upgrade1_9_016() return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.017'; } + +/** + * Some index to speed up access/update of huge history-logs + * + * ALTER TABLE `egw_history_log` ADD INDEX `egw_history_log_appname_record_id_id` (`history_appname`, `history_record_id`, `history_id`) + * DROP INDEX `egw_history_log_appname_record_id_status_timestamp` ON `egw_history_log` + */ +function phpgwapi_upgrade1_9_017() +{ + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_history_log', array('history_appname','history_record_id','history_id')); + $GLOBALS['egw_setup']->oProc->DropIndex('egw_history_log', array('history_appname','history_record_id','history_status','history_timestamp')); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.018'; +} +