From 436409a40bb569c49bf22b8955c79e4d42d3f72d Mon Sep 17 00:00:00 2001 From: Kevin Reed Date: Fri, 7 Sep 2018 10:10:03 -0500 Subject: [PATCH] server: Replace host index on userid with one based on userid and host_cpid --- db/constraints.sql | 7 +++---- html/ops/db_update.php | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/constraints.sql b/db/constraints.sql index d1f8646df4..3e5643902e 100644 --- a/db/constraints.sql +++ b/db/constraints.sql @@ -81,12 +81,11 @@ alter table msg_to_host -- for scheduler alter table host - add index host_user (userid), + add index host_userid_cpid (userid, host_cpid), -- html_user/host_user.php - add index host_cpid (host_cpid), - -- scheduler request for user with many hosts + -- sched/handle_request.cpp for user with many hosts add index host_domain_name (domain_name), - -- scheduler request for user with many hosts + -- sched/handle_request.cpp for user with many hosts add index host_avg (expavg_credit desc), -- db_dump.C add index host_tot (total_credit desc); diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 7fd14ad2a9..e8ae7d5735 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -1163,7 +1163,8 @@ function update_5_9_2018() { } function update_8_23_2018() { - $retval = do_query("alter table host add index host_cpid (host_cpid)"); + $retval = do_query("alter table host add index host_userid_cpid (userid, host_cpid)"); + $retval = $retval && do_query("alter table host drop index host_user"); return $retval && do_query("alter table host add index host_domain_name (domain_name)"); }