View Single Post
Old 11-16-2012, 08:31 PM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
UGH! VERY VERY BAD!

WHY are you using nick to join the two tables????

For that matter, WHY are you using nick in the COMMENTS table *AT ALL*!!!

You should REPLACE the nick field in COMMENTS with user_id and make it a FOREIGN KEY to the id field in USERS table.

But anyway, the reason it is so slow is that nick is NOT AN INDEX in your COMMENTS table!!!
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote