List:General Discussion« Previous MessageNext Message »
From:Pete McNeil Date:August 21 2003 12:35am
Subject:Re: Seeking advice on best table structure
View as plain text  
At 03:30 PM 8/20/2003 -0700, Scott Haneda wrote:
>What would be a good way to deal with the following...
>
>I have a form that has 5 checkboxes on it, lets say the checkboxes are for
>categories, and more than one can be selected.
>
>For example:
>please tell is what brochure you want
>[] car
>[] boat
>[] truck
>[] SUV
>[] beetle

<snip>

>I don't see the 5 categories being changed, so I could create 5 fields in
>one table, and tally them that way, or I could create one field and put the
>actual value in that field and tally them that way.
>
>Any suggestions are appreciated.


I'm gonna go out on a limb here. My intuition tells me to look for the 
opportunity to add some data to this process... For example, what if a 
record were created for each brochure that needed to be processed, and 
suppose that in some back-end application the person fulfilling these 
requests completed the data in the record... Then you might justify making 
a separate table for each brochure (or one with a two column key)... Then 
you would not waste space, you could gather statistics easily with joins, 
and you'd satisfy both processes at once...

then again, if none of that back-end process exists, then it's probably 
simplest to just make an integer column and bit-map the check-boxes into it 
(if you want to save space)... or if you don't care about space just create 
a true/false column for each check box.

The short answer is - more info is needed to pick the best approach.

HTH,
_M


Thread
Need help optimizing query, awfully slow on only 20000 recordsCarmel Entertainment)19 Aug
  • RE: Need help optimizing query, awfully slow on only 20000 recordsJim Smith20 Aug
RE: Need help optimizing query, awfully slow on only 20000 recordsCarmel Entertainment)20 Aug
  • RE: Need help optimizing query, awfully slow on only 20000 recordsMichael S. Fischer21 Aug
RE: Need help optimizing query, awfully slow on only 20000 recordsCarmel Entertainment)21 Aug
  • RE: Need help optimizing query, awfully slow on only 20000 recordsMichael S. Fischer21 Aug
  • Seeking advice on best table structureScott Haneda21 Aug
    • Re: Seeking advice on best table structurePete McNeil21 Aug
    • Re: Seeking advice on best table structureRoger Baklund21 Aug
      • Re: Seeking advice on best table structureRajesh Kumar21 Aug
        • Re: Seeking advice on best table structureRoger Baklund21 Aug
Re: Need help optimizing query, awfully slow on only 20000 recordsCarmel Entertainment)21 Aug
RE: Need help optimizing query, awfully slow on only 20000 recordsCarmel Entertainment)21 Aug
  • MySQL 4.0.13 Memory problem under heavy loadKayra Otaner21 Aug
    • RE: MySQL 4.0.13 Memory problem under heavy loadMichael S. Fischer21 Aug
    • Re: MySQL 4.0.13 Memory problem under heavy loadDan Nelson21 Aug
  • Re: MySQL 4.0.13 Memory problem under heavy loadMartin Gainty21 Aug