31 Jul
2006
31 Jul
'06
11:57 p.m.
On Jul 30, 2006, at 9:41 PM, Kieran Lal wrote:
mysql> EXPLAIN SELECT DISTINCT m.*, r.*, u.name, u.uid FROM cvs_messages m INNER JOIN cvs_repositories r ON m.rid = r.rid INNER JOIN users u ON m.uid = u.uid ORDER BY m.created
Here's what I think is happening. cvs_messages has 25K rows and is joining on cvs_repositories which has two rows, one for core and one for contrib. Then that is joined against users table which has approximately 80K users. 25K joined on 2 joined on 80K. I am wondering if we can just get the values from the cvs_repositories into a PHP array and then join cvs_messages to users on uid. Any ideas would be welcome. Cheers, Kieran