2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
alter table platform
|
|
|
|
add unique(name);
|
|
|
|
|
|
|
|
alter table app
|
|
|
|
add unique(name);
|
|
|
|
|
|
|
|
alter table app_version
|
2008-03-13 22:57:24 +00:00
|
|
|
add unique apvp (appid, platformid, version_num, plan_class);
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
alter table user
|
2003-01-03 22:17:40 +00:00
|
|
|
add unique(email_addr),
|
|
|
|
add unique(authenticator),
|
|
|
|
add index ind_tid (teamid),
|
2004-06-16 19:10:24 +00:00
|
|
|
add index user_name(name),
|
2003-01-31 07:19:20 +00:00
|
|
|
add index user_tot (total_credit desc),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- db_dump.C
|
2003-11-28 06:23:58 +00:00
|
|
|
add index user_avg (expavg_credit desc);
|
2003-12-02 22:04:26 +00:00
|
|
|
-- db_dump.C
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2002-07-11 20:35:05 +00:00
|
|
|
alter table team
|
2003-01-31 00:04:51 +00:00
|
|
|
add unique(name),
|
2007-10-26 21:14:35 +00:00
|
|
|
add fulltext index team_name_desc(name, description),
|
2007-11-20 22:58:14 +00:00
|
|
|
add fulltext index team_name(name),
|
2003-01-31 07:19:20 +00:00
|
|
|
add index team_avg (expavg_credit desc),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- db_dump.C
|
2006-10-27 16:06:42 +00:00
|
|
|
add index team_tot (total_credit desc),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- db_dump.C
|
2006-10-27 16:06:42 +00:00
|
|
|
add index team_userid (userid);
|
2002-07-11 20:35:05 +00:00
|
|
|
|
2002-04-30 22:22:54 +00:00
|
|
|
alter table workunit
|
2003-01-03 22:17:40 +00:00
|
|
|
add unique(name),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- not currently used but good invariant
|
2003-01-03 22:17:40 +00:00
|
|
|
add index wu_val (appid, need_validate),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- validator
|
2003-08-15 20:35:44 +00:00
|
|
|
add index wu_timeout (transition_time),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- transitioner
|
2005-01-07 19:45:46 +00:00
|
|
|
add index wu_filedel (file_delete_state),
|
2004-12-27 21:14:18 +00:00
|
|
|
-- file_deleter, db_purge
|
2003-01-03 22:17:40 +00:00
|
|
|
add index wu_assim (appid, assimilate_state);
|
2003-12-02 22:04:26 +00:00
|
|
|
-- assimilator
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
alter table result
|
2003-01-03 22:17:40 +00:00
|
|
|
add unique(name),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- the scheduler looks up results by name
|
|
|
|
|
2003-12-31 23:09:21 +00:00
|
|
|
add index res_wuid (workunitid),
|
|
|
|
-- transitioner
|
|
|
|
-- NOTE res_wu_user may suffice, could try dropping this one
|
2003-12-02 22:04:26 +00:00
|
|
|
|
2004-12-06 22:41:19 +00:00
|
|
|
add index ind_res_st (server_state, priority),
|
2004-07-08 19:20:19 +00:00
|
|
|
-- feeder
|
2003-12-02 22:04:26 +00:00
|
|
|
|
|
|
|
add index res_app_state(appid, server_state),
|
2007-07-09 20:09:49 +00:00
|
|
|
-- to get count of unsent results for given app (e.g. in work generator)
|
2003-12-02 22:04:26 +00:00
|
|
|
|
2003-08-15 17:36:44 +00:00
|
|
|
add index res_filedel (file_delete_state),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- file_deleter
|
|
|
|
|
|
|
|
add index res_userid_id(userid, id desc),
|
|
|
|
-- html_user/results.php
|
|
|
|
|
|
|
|
add index res_userid_val(userid, validate_state),
|
|
|
|
-- to show pending credit
|
|
|
|
|
2003-12-09 06:46:50 +00:00
|
|
|
add index res_hostid_id (hostid, id desc),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- html_user/results.php
|
|
|
|
|
2005-01-12 21:16:45 +00:00
|
|
|
add index res_wu_user (workunitid, userid);
|
2003-12-02 22:04:26 +00:00
|
|
|
-- scheduler (avoid sending mult results of same WU to one user)
|
|
|
|
|
2004-06-24 21:00:46 +00:00
|
|
|
alter table msg_from_host
|
|
|
|
add index message_handled (handled);
|
|
|
|
-- for message handler
|
2004-03-17 01:26:44 +00:00
|
|
|
|
2004-06-24 21:00:46 +00:00
|
|
|
alter table msg_to_host
|
|
|
|
add index msg_to_host(hostid, handled);
|
2004-03-17 01:26:44 +00:00
|
|
|
-- for scheduler
|
2004-01-04 06:48:40 +00:00
|
|
|
|
2003-01-03 22:17:40 +00:00
|
|
|
alter table host
|
2003-01-31 07:19:20 +00:00
|
|
|
add index host_user (userid),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- html_user/host_user.php
|
2003-01-31 07:19:20 +00:00
|
|
|
add index host_avg (expavg_credit desc),
|
2003-12-02 22:04:26 +00:00
|
|
|
-- db_dump.C
|
2003-01-31 07:19:20 +00:00
|
|
|
add index host_tot (total_credit desc);
|
2003-12-02 22:04:26 +00:00
|
|
|
-- db_dump.C
|
2003-10-24 20:13:50 +00:00
|
|
|
|
|
|
|
alter table profile
|
2003-12-31 23:09:21 +00:00
|
|
|
add fulltext index profile_reponse(response1, response2),
|
2004-06-01 17:02:14 +00:00
|
|
|
add index pro_uotd (uotd_time desc),
|
2003-10-24 20:13:50 +00:00
|
|
|
add unique profile_userid(userid);
|
2003-12-02 22:04:26 +00:00
|
|
|
|
|
|
|
alter table subscriptions
|
|
|
|
add unique sub_unique(userid, threadid);
|
2003-12-09 06:46:50 +00:00
|
|
|
|
2004-02-17 02:16:53 +00:00
|
|
|
alter table category
|
|
|
|
add unique cat1(name, is_helpdesk);
|
|
|
|
|
|
|
|
alter table forum
|
2007-11-14 21:55:05 +00:00
|
|
|
add unique pct (parent_type, category, title);
|
2004-02-17 02:16:53 +00:00
|
|
|
|
2003-12-09 06:46:50 +00:00
|
|
|
alter table thread
|
|
|
|
add fulltext index thread_title(title);
|
|
|
|
|
|
|
|
alter table post
|
2003-12-21 05:55:48 +00:00
|
|
|
add index post_user (user),
|
|
|
|
add index post_thread (thread),
|
2003-12-09 06:46:50 +00:00
|
|
|
add fulltext index post_content(content);
|
2007-05-02 18:51:51 +00:00
|
|
|
|
2007-05-02 23:17:52 +00:00
|
|
|
alter table credited_job
|
2007-07-27 18:30:10 +00:00
|
|
|
add index credited_job_user (userid),
|
|
|
|
add index credited_job_wu (workunitid),
|
|
|
|
add unique credited_job_user_wu (userid, workunitid);
|
|
|
|
|
|
|
|
alter table team_delta
|
|
|
|
add index team_delta_teamid (teamid, timestamp);
|
2007-11-03 04:26:47 +00:00
|
|
|
|
|
|
|
alter table team_admin
|
|
|
|
add unique (teamid, userid);
|
2007-12-18 20:28:08 +00:00
|
|
|
|
|
|
|
alter table friend
|
|
|
|
add unique friend_u (user_src, user_dest);
|
|
|
|
|
|
|
|
alter table notify
|
2007-12-30 22:02:16 +00:00
|
|
|
add unique notify_un (userid, type, opaque);
|
2010-03-29 22:28:20 +00:00
|
|
|
|
|
|
|
alter table host_app_version
|
|
|
|
add unique hap(host_id, app_version_id);
|
2012-01-30 22:39:13 +00:00
|
|
|
|
|
|
|
alter table assignment
|
|
|
|
add index asgn_target(target_type, target_id);
|
2012-11-26 03:12:08 +00:00
|
|
|
|
|
|
|
alter table job_file
|
|
|
|
add index md5(md5);
|