>
> *Real life:*
> A questionnaire is grouped into several sections (e.g. personal details,
> contacts, education, work experience etc), each section then has multiple
> questions.
>
> *Current implementation:*
> I have 3 tables; questionnaires (columns: id, title, ...), sections (id,
> questionnaire_id, ...) and questions (id, section_id, ...). The columns
> questionnaire_id and section_id are indexed, and all "id" columns are
> primary keys, auto increment.
>
> *The need:*
> I need to get all questions that belong to a specific questionnaire. Lets
> assume the id of this questionnaire is 1.
>
> *Method 1:*
> 1. Run the query "SELECT id FROM sections WHERE questionnaire_id=1"
> 2. Do some PHP code to retrieve the ids and convert them into CSV format,
> e.g. 1, 2, 3
> 3. Run the query "SELECT id, title, ... FROM questions WHERE section_id IN
> (1,2,3)"
>
> *Method 2:*
> 1. Run the query "SELECT id, title, ... FROM questions WHERE section_id IN
> (SELECT id FROM sections WHERE questionnaire_id=1)"
>
> *Question:*
> Which is the better method in terms of speed and scalability?
Would go with the first one. Sub queries are better avoided.
But test which is faster by running them through explain
William
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://orion.my.co.ke/cgi-bin/mailman/private/skunkworks/attachments/20120829/0309eae1/attachment-0001.htm>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 29 Aug 2012 11:29:06 +0300
> From: Philip Musyoki <pmusyoki@gmail.com>
> To: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
> Subject: Re: [Skunkworks] Samsung TV vs Sony Internet TV ?
> Message-ID:
> <CACvauYh6DXL8w3i6fXH7DwhMrVAatwRWx1ygeOmrXMXiE+SBZg@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> @William,
>
> You may also know that Samsung makes most of the component for the iPad.
> But that doesn't mean the Samsung Galaxy is better than the iPad.
>
> It is not about who makes the best LED TFTs' but the best television. A LED
> TFT is now a commodity anyone from Samsung, LG and Foxconn can make.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://orion.my.co.ke/cgi-bin/mailman/private/skunkworks/attachments/20120829/677e96d7/attachment-0001.htm>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 29 Aug 2012 11:38:28 +0300
> From: David Njuki <njukey@gmail.com>
> To: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
> Subject: Re: [Skunkworks] DSTV program repeatition
> Message-ID:
> <CAHM9YQq3DHwJE3JEYPGEHdym7v++hTVE4w2pn2PHNoUgjBa2CQ@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 2012/8/28 Erick Njenga <eriknjenga@gmail.com>
>
> > DSTV's response: http://forum.dstv.com/showthread.php?t=7757
> >
> >
> That page is 2 years old.
>
>
> --
> ???????????????????????
> Regards,
> David Njuki
> @njukey [Google,Twitter,Yahoo]
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://orion.my.co.ke/cgi-bin/mailman/private/skunkworks/attachments/20120829/311f0448/attachment-0001.htm>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 29 Aug 2012 11:42:53 +0300
> From: Martin Gicheru <martin@techweez.com>
> To: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
> Subject: Re: [Skunkworks] Samsung TV vs Sony Internet TV ?
> Message-ID:
> <CABvSyMfBekS+XjQb9+FbJdrfBrwpxVRBSxEQpfqThOckF+oYpQ@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> What I would advise is you buy a Samsung Smart Tv, mostly if you are gonna
> use a Samsung smartphone, the apps, the DLNA and Allshare play are some of
> the things you will gain off it. Beyond the usual display checks. I wish I
> had noted all these before I purchased the Sony Bravia tv, now I have a
> Galaxy S 3 but cannot utilise the full potential at home like gaming on TV
> using my phone wirelessely.
>
> On Wed, Aug 29, 2012 at 11:29 AM, Philip Musyoki <pmusyoki@gmail.com> wrote:
>
> > @William,
> >
> > You may also know that Samsung makes most of the component for the iPad.
> > But that doesn't mean the Samsung Galaxy is better than the iPad.
> >
> > It is not about who makes the best LED TFTs' but the best television. A
> > LED TFT is now a commodity anyone from Samsung, LG and Foxconn can make.
> >
> > _______________________________________________
> > Skunkworks mailing list
> > Skunkworks@lists.my.co.ke
> > ------------
> > List info, subscribe/unsubscribe
> > http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> > ------------
> >
> > Skunkworks Rules
> > http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> > ------------
> > Other services @ http://my.co.ke
> >
>
>
>
> --
>
> Regards,
>
> Martin Gicheru|Business Development|Techweez Solutions
>
> Email ID: martin@techweez.com | Tel:254721906171 | Website:
> http://www.techweez.com |
>
> Skype ID: martingicheru | Twitter ID:martingicheru | Gtalk:
> martin@techweez.com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://orion.my.co.ke/cgi-bin/mailman/private/skunkworks/attachments/20120829/73b4a3c2/attachment-0001.htm>
>
> ------------------------------
>
> Message: 5
> Date: Wed, 29 Aug 2012 11:54:49 +0300
> From: toto mdogo <totomdogo@gmail.com>
> To: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
> Subject: Re: [Skunkworks] Amazon
> Message-ID:
> <CACwDODnkieLeGB-oPpogaUNqmX1-U23eELDb+SvJ4t1FF+GSNA@mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> @TheBigBoss,
>
> zero VAT? How does that affect what I (might) be charged once the package
> comes into the country? Is there any predefined rate for the taxes to be
> charged?
>
> I am assuming FEDEX/DHL will bring it directly to me (location indicated as
> shipping address). At what point does the GoK take its pound of flesh (if
> at all)?
>
> --
> t~0~t~0
>
>
>
> On Wed, Aug 29, 2012 at 9:59 AM, TheBigBoss <thebigboss@peperuka.com> wrote:
>
> > Package from Europe using ordinary post takes about 2 to 3 weeks. I guess
> > it should be the same from US but since Amazon is a big company and I guess
> > partnered with DHL or FEDEX, it may come in 1 week.
> >
> > Don't forget to claim for zero VAT as items shipped outside US/EU should
> > be zero VAT
> >
> >
> >
> >
> > On 29 August 2012 08:57, <awatila@yahoo.co.uk> wrote:
> >
> >> Have bought books
> >> the time depends on whether you use courier or ordinary post
> >>
> >> Regards,
> >>
> >> Alex Watila
> >> ICT Manager
> >> Kenya School of Law
> >> Langata-South Road, Karen
> >> alternative email address: awatila@yahoo.co.uk
> >> CDMA : +254(020)2103200
> >> skype: awatila
> >> To call us free, sms to 4991: School of Law
> >> Telkom Wireless +254(020) 2699581,2699582, 2699583, 2699584, 2699585,
> >> 2699586
> >> Tel +254 20 8890 044/94, 8891 399, 8891 200
> >> Fax +254 20 8891 722
> >> ?You can visit KSL on the internet at www.ksl.ac.ke?
> >>
> >> *From:* toto mdogo <totomdogo@gmail.com>
> >> *Sent:* Wednesday, August 29, 2012 8:14 AM
> >> *To:* Skunkworks Mailing List <skunkworks@lists.my.co.ke>
> >> *Subject:* [Skunkworks] Amazon
> >>
> >> Morning everyone,
> >>
> >> Has anyone on the list bought items to Kenya via Amazon?
> >>
> >> How easy is the whole process? How long does it take &c?
> >>
> >>
> >> Thanks.
> >> --
> >> t~0~t~0
> >>
> >>
> >> ------------------------------
> >> _______________________________________________
> >> Skunkworks mailing list
> >> Skunkworks@lists.my.co.ke
> >> ------------
> >> List info, subscribe/unsubscribe
> >> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> >> ------------
> >>
> >> Skunkworks Rules
> >> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> >> ------------
> >> Other services @ http://my.co.ke
> >>
> >>
> >> _______________________________________________
> >> Skunkworks mailing list
> >> Skunkworks@lists.my.co.ke
> >> ------------
> >> List info, subscribe/unsubscribe
> >> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> >> ------------
> >>
> >> Skunkworks Rules
> >> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> >> ------------
> >> Other services @ http://my.co.ke
> >>
> >
> >
> > _______________________________________________
> > Skunkworks mailing list
> > Skunkworks@lists.my.co.ke
> > ------------
> > List info, subscribe/unsubscribe
> > http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> > ------------
> >
> > Skunkworks Rules
> > http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> > ------------
> > Other services @ http://my.co.ke
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.my.co.ke/cgi-bin/mailman/private/skunkworks/attachments/20120829/66575a50/attachment.htm>
>
> ------------------------------
>
> _______________________________________________
> Skunkworks mailing list
> Skunkworks@lists.my.co.ke
> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> ------------
> Skunkworks Server donations spreadsheet
> http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
> ------------
> Skunkworks Rules
> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> ------------
> Other services @ http://my.co.ke
>
> End of Skunkworks Digest, Vol 30, Issue 240
> *******************************************