Some index to speed up access/update of huge history-logs

This commit is contained in:
Ralf Becker 2012-07-05 09:24:51 +00:00
parent 86df4ba58b
commit 535051e77f
3 changed files with 17 additions and 2 deletions

View File

@ -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;

View File

@ -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(

View File

@ -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';
}