Just in case you need some more information about how to fix your queries, this walks you through some examples http://hackmysql.com/case2
On Mon, Mar 22, 2010 at 10:00 AM, Nicholas Hart <nh...@partsauthority.com>wrote: > I am looking to analyze and speed up some of my queries by adding any > necessary indexes. Is there a formula to follow in adding indexes to > multiple join queries? I have made some attempts using explain but am not > sure I understand it all that well. > > For example: > $sql = "select dt1.*, d.* from > driver d join > (select `driver`, date(`leave`), sum(`points`) as pnts, > sum(`xpnts`) as xpnts from check_head > where date(`leave`) = '".$sdate."' > group by `driver`) dt1 > on dt1.driver = d.id_num where `store` = '".$userStore."' "; > > Any suggestions welcome. Thanks. > > Nick > >
_______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation