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(
idbigint(20) NOT NULL,
useridbigint(20) NOT NULL DEFAULT ‘0’,
to_userint(11) NOT NULL DEFAULT ‘0’,
usernamevarchar(25) CHARACTER SET utf8 DEFAULT NULL,
dateint(11) NOT NULL DEFAULT ‘0’,
texttext CHARACTER SET utf8,
text_parsedtext CHARACTER SET utf8,
staff_shoutenum(‘yes’,‘no’) COLLATE utf8_unicode_ci NOT NULL DEFAULT ‘no’,
autoshoutenum(‘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);
