Can someone help me on finding the proper indexes for a table? using explain it keeps showing me that it uses where and filesort and it keep loading slowly and slowly when the rows amount keep pile up…
CREATE TABLE IF NOT EXISTS
shoutbox
(
id
bigint(20) NOT NULL,
userid
bigint(20) NOT NULL DEFAULT ‘0’,
to_user
int(11) NOT NULL DEFAULT ‘0’,
username
varchar(25) CHARACTER SET utf8 DEFAULT NULL,
date
int(11) NOT NULL DEFAULT ‘0’,
text
text CHARACTER SET utf8,
text_parsed
text CHARACTER SET utf8,
staff_shout
enum(‘yes’,‘no’) COLLATE utf8_unicode_ci NOT NULL DEFAULT ‘no’,
autoshout
enum(‘yes’,‘no’) COLLATE utf8_unicode_ci NOT NULL DEFAULT ‘no’
) ENGINE=MyISAM AUTO_INCREMENT=272 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;ALTER TABLE
shoutbox
ADD PRIMARY KEY (id
), ADD KEYfor
(to_user
), ADD KEYuserid
(userid
), ADD KEYusername
(username
), ADD KEYstaff
(staff_shout
);