[nycphp-talk] Adding indexes

Nicholas Hart nhart at
Mon Mar 22 11:00:41 EDT 2010

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.


On Sun, Mar 21, 2010 at 12:00 PM, <talk-request at> wrote:

> Send talk mailing list submissions to
>        talk at
> To subscribe or unsubscribe via the World Wide Web, visit
> or, via email, send a message with subject or body 'help' to
>        talk-request at
> You can reach the person managing the list at
>        talk-owner at
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of talk digest..."
> Today's Topics:
>   1. Anyone using Indeferno? (Gary Mort)
> ----------------------------------------------------------------------
> Message: 1
> Date: Sun, 21 Mar 2010 09:55:15 -0400
> From: Gary Mort <garyamort at>
> To: NYPHP Talk <talk at>
> Subject: [nycphp-talk] Anyone using Indeferno?
> Message-ID:
>        <4bffc351003210655u203f4114i60ac97dad21ad011 at>
> Content-Type: text/plain; charset="iso-8859-1"
> I gave redmine a try and it's good, let's me work the way I think and
> all....integrates with Bazaar.....etc etc.
> All the good stuff.
> The downside though was that it just lacks  a decent templating system,
> lacks some basic API's, etc.
> At the end of the day...  to get to where I want to be I find I need to
> change /something/.....
> In the case of meant implementing a SOAP API in order to do
> some integration with some tools that already have SOAP connectors but
> don't
> have REST connectors...  And the Ruby kids are so down on SOAP that a lot
> of
> the cool generators that are supposed to make Ruby on Rails so fantastic
> don't really work well - and the Ruby answer is a smug "well, you should
> use
> REST"...... given a choice between coding a new integration library in Java
> or coding an API in Ruby, I would prefer to work in Ruby.
> Wheras Indeferno, is PHP.....which in theory
> makes
> it easier to program for[of course, it uses it's own fun little
> framework]...
> It means switching to Mercurial or Git....but then those are more widely
> used anyway, so it's not a hardship.
> Figured I'd ask if anyone else has played with it before looking further
> into that route.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> >
> ------------------------------
> _______________________________________________
> talk mailing list
> talk at
> End of talk Digest, Vol 41, Issue 14
> ************************************


-Nicholas Hart
Parts Authority IT
516-678-3900 X3242
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list