<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Jul 30, 2006, at 9:41 PM, Kieran Lal wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">mysql> EXPLAIN SELECT DISTINCT m.*, r.*, u.name, u.uid FROM cvs_messages m<SPAN class="Apple-converted-space"> </SPAN>INNER JOIN cvs_repositories r ON m.rid = r.rid INNER JOIN users u ON m.uid = u.uid<SPAN class="Apple-converted-space"> </SPAN>ORDER BY m.created<SPAN class="Apple-converted-space"> </SPAN></FONT></P> </BLOCKQUOTE></DIV><BR><DIV>Here's what I think is happening.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>cvs_messages has 25K rows and is joining on cvs_repositories which has two rows, one for core and one for contrib.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Then that is joined against users table which has approximately 80K users.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV>Kieran</DIV></BODY></HTML>