From 62a5869b7f1fb2e602d8633fc2520be14c0e3754 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 4 Jan 2012 21:55:06 +0000 Subject: [PATCH] * Addressbook/CardDAV: Add index for contact_modified to improve performance of ctag generation on big installtions --- phpgwapi/setup/setup.inc.php | 3 ++- phpgwapi/setup/tables_current.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index c3696971da..7c3d15ee55 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.012'; +$setup_info['phpgwapi']['version'] = '1.9.013'; $setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; @@ -75,3 +75,4 @@ $setup_info['groupdav']['license'] = 'GPL'; $setup_info['groupdav']['hooks']['preferences'] = 'groupdav_hooks::menus'; $setup_info['groupdav']['hooks']['settings'] = 'groupdav_hooks::settings'; + diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index 9e877d358b..96d5dcf24f 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -345,7 +345,7 @@ $phpgw_baseline = array( ), 'pk' => array('contact_id'), 'fk' => array(), - 'ix' => array('contact_owner','cat_id','n_fileas','contact_uid','carddav_name',array('n_family','n_given'),array('n_given','n_family'),array('org_name','n_family','n_given')), + 'ix' => array('contact_owner','cat_id','n_fileas','contact_modified','contact_uid','carddav_name',array('n_family','n_given'),array('n_given','n_family'),array('org_name','n_family','n_given')), 'uc' => array('account_id') ), 'egw_addressbook_extra' => array( diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index e45ebc88ae..1ca0c51f59 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -326,3 +326,13 @@ function phpgwapi_upgrade1_9_011() return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.012'; } + +/** + * Add index for contact_modified to improve performance of ctag generation on big installtions + */ +function phpgwapi_upgrade1_9_012() +{ + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook','contact_modified'); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.013'; +}