Skip to content

Commit

Permalink
Issue #2974363 by helmo, millenniumtree: Hostmaster database slows co…
Browse files Browse the repository at this point in the history
…nsiderably with more tasks in database
  • Loading branch information
helmo authored and helmo committed Jul 12, 2018
1 parent 5ee1cf4 commit 8b198de
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions task/hosting_task.install
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ function hosting_task_schema() {
'not null' => FALSE,
),
),
'indexes' => array(
'nid' => array('nid'),
),
'primary key' => array('vid'),
);

Expand Down Expand Up @@ -73,6 +76,10 @@ function hosting_task_schema() {
'not null' => FALSE,
),
),
'indexes' => array(
'vid' => array('vid'),
'nid' => array('nid'),
),
);

$schema['hosting_task_log'] = array(
Expand Down Expand Up @@ -335,3 +342,18 @@ function hosting_task_update_7001() {
user_role_grant_permissions($role->rid, array('create login-reset task'));
}
}

/**
* Add indexes to the hosting_task and hosting_task_arguments tables.
*/
function hosting_task_update_7301() {
if (!db_index_exists('hosting_task', 'hosting_task_nid_idx')) {
db_add_index('hosting_task', 'hosting_task_nid_idx', array('nid'));
}
if (!db_index_exists('hosting_task_arguments', 'hosting_task_arguments_nid_idx')) {
db_add_index('hosting_task_arguments', 'hosting_task_arguments_nid_idx', array('nid'));
}
if (!db_index_exists('hosting_task_arguments', 'hosting_task_arguments_vid_idx')) {
db_add_index('hosting_task_arguments', 'hosting_task_arguments_vid_idx', array('vid'));
}
}

0 comments on commit 8b198de

Please sign in to comment.