NYCPHP Meetup

NYPHP.org

[nycphp-talk] Adding indexes

Nicholas Hart nhart at partsauthority.com
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.

Nick


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

> Send talk mailing list submissions to
>        talk at lists.nyphp.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.nyphp.org/mailman/listinfo/talk
> or, via email, send a message with subject or body 'help' to
>        talk-request at lists.nyphp.org
>
> You can reach the person managing the list at
>        talk-owner at lists.nyphp.org
>
> 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 gmail.com>
> To: NYPHP Talk <talk at lists.nyphp.org>
> Subject: [nycphp-talk] Anyone using Indeferno?
> Message-ID:
>        <4bffc351003210655u203f4114i60ac97dad21ad011 at mail.gmail.com>
> 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 Redmine....it 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, http://www.indefero.net/ 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: <
> http://lists.nyphp.org/pipermail/talk/attachments/20100321/8641b688/attachment-0001.html
> >
>
> ------------------------------
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
> 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: <http://lists.nyphp.org/pipermail/talk/attachments/20100322/edd83ebb/attachment.html>


More information about the talk mailing list