Skip to content

Commit

Permalink
Add indexes for tokens and points columns, hopefully help speed up
Browse files Browse the repository at this point in the history
moderatord task changes and keep DBs from bogging.
  • Loading branch information
jamiemccarthy committed Nov 3, 2004
1 parent e87f769 commit 5597003
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sql/mysql/slashschema_create.sql
Expand Up @@ -1145,7 +1145,8 @@ CREATE TABLE users_comments (
noscores tinyint DEFAULT '0' NOT NULL,
mode ENUM('flat', 'nested', 'nocomment', 'thread') DEFAULT 'thread' NOT NULL,
threshold tinyint DEFAULT '0' NOT NULL,
PRIMARY KEY (uid)
PRIMARY KEY (uid),
KEY points (points)
) TYPE=InnoDB;

#
Expand Down Expand Up @@ -1229,7 +1230,8 @@ CREATE TABLE users_info (
people MEDIUMBLOB,
PRIMARY KEY (uid),
KEY (initdomain),
KEY (created_ipid)
KEY (created_ipid),
KEY tokens (tokens)
) TYPE=InnoDB;

#
Expand Down
3 changes: 3 additions & 0 deletions sql/mysql/upgrades
Expand Up @@ -2703,3 +2703,6 @@ INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_max_day','
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_max_month','20','How many remarks a single user can send, in a month, before we start ignoring them');
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_max_year','100','How many remarks a single user can send, in a year, before we start ignoring them');

ALTER TABLE users_info ADD INDEX tokens (tokens);
ALTER TABLE users_comments ADD INDEX points (points);

0 comments on commit 5597003

Please sign in to comment.