From 3b93f3845d5e37fc89f81290874abce8ae1f29bd Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 27 Jun 2004 09:54:57 +0000 Subject: [PATCH] creating indices for infolog --- infolog/setup/setup.inc.php | 5 ++- infolog/setup/tables_current.inc.php | 22 +++++----- infolog/setup/tables_update.inc.php | 65 ++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 13 deletions(-) diff --git a/infolog/setup/setup.inc.php b/infolog/setup/setup.inc.php index c4104f1c20..f1538a93eb 100755 --- a/infolog/setup/setup.inc.php +++ b/infolog/setup/setup.inc.php @@ -12,7 +12,7 @@ /* $Id$ */ $setup_info['infolog']['name'] = 'infolog'; - $setup_info['infolog']['version'] = '0.9.15.006'; + $setup_info['infolog']['version'] = '0.9.15.008'; $setup_info['infolog']['app_order'] = 5; $setup_info['infolog']['tables'] = array('phpgw_infolog','phpgw_links','phpgw_infolog_extra'); $setup_info['infolog']['enable'] = 1; @@ -69,4 +69,5 @@ 'appname' => 'etemplate', 'versions' => Array('0.9.15','0.9.16','1.0.0') ); -?> + + diff --git a/infolog/setup/tables_current.inc.php b/infolog/setup/tables_current.inc.php index ffb546974d..01b78a9d13 100644 --- a/infolog/setup/tables_current.inc.php +++ b/infolog/setup/tables_current.inc.php @@ -16,29 +16,29 @@ 'fd' => array( 'info_id' => array('type' => 'auto','nullable' => False), 'info_type' => array('type' => 'varchar','precision' => '10','nullable' => False,'default' => 'task'), - 'info_from' => array('type' => 'varchar','precision' => '64','nullable' => True), - 'info_addr' => array('type' => 'varchar','precision' => '64','nullable' => True), - 'info_subject' => array('type' => 'varchar','precision' => '64','nullable' => True), - 'info_des' => array('type' => 'text','nullable' => True), + 'info_from' => array('type' => 'varchar','precision' => '64'), + 'info_addr' => array('type' => 'varchar','precision' => '64'), + 'info_subject' => array('type' => 'varchar','precision' => '64'), + 'info_des' => array('type' => 'text'), 'info_owner' => array('type' => 'int','precision' => '4','nullable' => False), 'info_responsible' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'info_access' => array('type' => 'varchar','precision' => '10','nullable' => True,'default' => 'public'), + 'info_access' => array('type' => 'varchar','precision' => '10','default' => 'public'), 'info_cat' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), 'info_datemodified' => array('type' => 'int','precision' => '4','nullable' => False), 'info_startdate' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), 'info_enddate' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), 'info_id_parent' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'info_pri' => array('type' => 'varchar','precision' => '10','nullable' => True,'default' => 'normal'), + 'info_pri' => array('type' => 'varchar','precision' => '10','default' => 'normal'), 'info_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), 'info_bill_cat' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'info_status' => array('type' => 'varchar','precision' => '10','nullable' => True,'default' => 'done'), - 'info_confirm' => array('type' => 'varchar','precision' => '10','nullable' => True,'default' => 'not'), + 'info_status' => array('type' => 'varchar','precision' => '10','default' => 'done'), + 'info_confirm' => array('type' => 'varchar','precision' => '10','default' => 'not'), 'info_modifier' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), 'info_link_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0') ), 'pk' => array('info_id'), 'fk' => array(), - 'ix' => array(), + 'ix' => array(array('info_owner','info_responsible','info_status','info_startdate'),array('info_id_parent','info_owner','info_responsible','info_status','info_startdate')), 'uc' => array() ), 'phpgw_links' => array( @@ -48,13 +48,13 @@ 'link_id1' => array('type' => 'varchar','precision' => '50','nullable' => False), 'link_app2' => array('type' => 'varchar','precision' => '25','nullable' => False), 'link_id2' => array('type' => 'varchar','precision' => '50','nullable' => False), - 'link_remark' => array('type' => 'varchar','precision' => '50','nullable' => True), + 'link_remark' => array('type' => 'varchar','precision' => '50'), 'link_lastmod' => array('type' => 'int','precision' => '4','nullable' => False), 'link_owner' => array('type' => 'int','precision' => '4','nullable' => False) ), 'pk' => array('link_id'), 'fk' => array(), - 'ix' => array(), + 'ix' => array(array('link_app1','link_id1','link_lastmod'),array('link_app2','link_id2','link_lastmod')), 'uc' => array() ), 'phpgw_infolog_extra' => array( diff --git a/infolog/setup/tables_update.inc.php b/infolog/setup/tables_update.inc.php index eb5b23464c..22ce24884f 100644 --- a/infolog/setup/tables_update.inc.php +++ b/infolog/setup/tables_update.inc.php @@ -259,4 +259,69 @@ $GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.006'; return $GLOBALS['setup_info']['infolog']['currentver']; } + + + // the following series of updates add some indices, to speedup the selects + + $test[] = '0.9.15.006'; + function infolog_upgrade0_9_15_006() + { + $GLOBALS['phpgw_setup']->oProc->RefreshTable('phpgw_links',array( + 'fd' => array( + 'link_id' => array('type' => 'auto','nullable' => False), + 'link_app1' => array('type' => 'varchar','precision' => '25','nullable' => False), + 'link_id1' => array('type' => 'varchar','precision' => '50','nullable' => False), + 'link_app2' => array('type' => 'varchar','precision' => '25','nullable' => False), + 'link_id2' => array('type' => 'varchar','precision' => '50','nullable' => False), + 'link_remark' => array('type' => 'varchar','precision' => '50'), + 'link_lastmod' => array('type' => 'int','precision' => '4','nullable' => False), + 'link_owner' => array('type' => 'int','precision' => '4','nullable' => False) + ), + 'pk' => array('link_id'), + 'fk' => array(), + 'ix' => array(array('link_app1','link_id1','link_lastmod'),array('link_app2','link_id2','link_lastmod')), + 'uc' => array() + )); + + $GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.007'; + return $GLOBALS['setup_info']['infolog']['currentver']; + } + + + $test[] = '0.9.15.007'; + function infolog_upgrade0_9_15_007() + { + $GLOBALS['phpgw_setup']->oProc->RefreshTable('phpgw_infolog',array( + 'fd' => array( + 'info_id' => array('type' => 'auto','nullable' => False), + 'info_type' => array('type' => 'varchar','precision' => '10','nullable' => False,'default' => 'task'), + 'info_from' => array('type' => 'varchar','precision' => '64'), + 'info_addr' => array('type' => 'varchar','precision' => '64'), + 'info_subject' => array('type' => 'varchar','precision' => '64'), + 'info_des' => array('type' => 'text'), + 'info_owner' => array('type' => 'int','precision' => '4','nullable' => False), + 'info_responsible' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_access' => array('type' => 'varchar','precision' => '10','default' => 'public'), + 'info_cat' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_datemodified' => array('type' => 'int','precision' => '4','nullable' => False), + 'info_startdate' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_enddate' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_id_parent' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_pri' => array('type' => 'varchar','precision' => '10','default' => 'normal'), + 'info_time' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_bill_cat' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_status' => array('type' => 'varchar','precision' => '10','default' => 'done'), + 'info_confirm' => array('type' => 'varchar','precision' => '10','default' => 'not'), + 'info_modifier' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'info_link_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0') + ), + 'pk' => array('info_id'), + 'fk' => array(), + 'ix' => array(array('info_owner','info_responsible','info_status','info_startdate'),array('info_id_parent','info_owner','info_responsible','info_status','info_startdate')), + 'uc' => array() + )); + + $GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.008'; + return $GLOBALS['setup_info']['infolog']['currentver']; + } ?>