SELECT thread.threadid, table1.threadid, table1.name FROM `table1`, `thread` WHERE forumid = 10 GROUP BY name ORDER BY table1.threadid DESC LIMIT 0,50 table type possible_keys key key_len ref rows Extra thread ref forumid forumid 2 const 266 Using where; Using temporary; Using filesort table1 ALL NULL NULL NULL NULL 7136