db/table design question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • G

    #1

    db/table design question

    Hi,

    I have table/db I need to create that has a rectangle structure even
    when normalized, but the difficulty is that the rows can have a large
    number of column - over the max of what mysql can handle. If I put the
    data in vertical format I lose a lot of functionality. If I split the
    tables into n number of tables and keep the data on the horizontal it make
    for some combersomeness. I'm sure this is a common problem but I have
    never need more that 5-20 columns per table.

    any input on this is greatly appreciated!

    I also am considering writing code that may compress/decompress the
    columns into say a blob, but this again leaves me in the cold, with out
    the power of sql...


    Gary
  • Speedy LJ

    #2
    Re: db/table design question

    how many columns do you need per table ?


    "G" <nospam@nospam. org> wrote in message
    news:pan.2005.0 3.31.01.07.06.9 6158@nospam.org ...[color=blue]
    > Hi,
    >
    > I have table/db I need to create that has a rectangle structure even
    > when normalized, but the difficulty is that the rows can have a large
    > number of column - over the max of what mysql can handle. If I put the
    > data in vertical format I lose a lot of functionality. If I split the
    > tables into n number of tables and keep the data on the horizontal it make
    > for some combersomeness. I'm sure this is a common problem but I have
    > never need more that 5-20 columns per table.
    >
    > any input on this is greatly appreciated!
    >
    > I also am considering writing code that may compress/decompress the
    > columns into say a blob, but this again leaves me in the cold, with out
    > the power of sql...
    >
    >
    > Gary[/color]


    Comment

    • G

      #3
      Re: db/table design question

      i'm working with genetic data and it's composed of
      marker1 allele1_1 allele1_2 .... markerN alleleN_1 alleleN_2
      they tell me there can be upto 1400 markers per individual. I could
      make the markers a 1 to many table and add a way to associate them to the
      alleles, but that still leaves me at about 2800+ column. hope this sheds
      some light on what you asked? thanks.


      On Thu, 31 Mar 2005 12:59:58 +1000, Speedy LJ wrote:
      [color=blue]
      > how many columns do you need per table ?
      >
      >
      > "G" <nospam@nospam. org> wrote in message
      > news:pan.2005.0 3.31.01.07.06.9 6158@nospam.org ...[color=green]
      >> Hi,
      >>
      >> I have table/db I need to create that has a rectangle structure even
      >> when normalized, but the difficulty is that the rows can have a large
      >> number of column - over the max of what mysql can handle. If I put the
      >> data in vertical format I lose a lot of functionality. If I split the
      >> tables into n number of tables and keep the data on the horizontal it make
      >> for some combersomeness. I'm sure this is a common problem but I have
      >> never need more that 5-20 columns per table.
      >>
      >> any input on this is greatly appreciated!
      >>
      >> I also am considering writing code that may compress/decompress the
      >> columns into say a blob, but this again leaves me in the cold, with out
      >> the power of sql...
      >>
      >>
      >> Gary[/color][/color]

      Comment

      • Jeff North

        #4
        Re: db/table design question

        On Wed, 30 Mar 2005 20:08:33 -0800, in mailing.databas e.mysql G
        <nospam@nospam. org> wrote:
        [color=blue]
        >| i'm working with genetic data and it's composed of
        >| marker1 allele1_1 allele1_2 .... markerN alleleN_1 alleleN_2
        >| they tell me there can be upto 1400 markers per individual. I could
        >| make the markers a 1 to many table and add a way to associate them to the
        >| alleles, but that still leaves me at about 2800+ column. hope this sheds
        >| some light on what you asked? thanks.[/color]

        How about:
        table Marker
        PKMarkerID int(11) auto-increment
        <other data fields>


        Table Alleles
        fkMarkerID int(11)
        alleleNbr int(10) unsigned
        alleleValue int(11)

        This would store the data in the most efficient method.
        Later on you could retrieve selective information like:
        SELECT *
        FROM Alleles
        WHERE alleleNbr = 10 and alleleValue between 50 and 100;
        ---------------------------------------------------------------
        jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
        ---------------------------------------------------------------

        Comment

        • G

          #5
          Re: db/table design question

          yes, the more I think about this the better it sounds.
          when i start developing with it it may get trickier.
          having it all horizontal made for easy 'order by's for
          the web, but you have to give up somethings. thanks, g.

          On Thu, 31 Mar 2005 16:00:52 +0000, Jeff North wrote:
          [color=blue]
          > On Wed, 30 Mar 2005 20:08:33 -0800, in mailing.databas e.mysql G
          > <nospam@nospam. org> wrote:
          >[color=green]
          >>| i'm working with genetic data and it's composed of
          >>| marker1 allele1_1 allele1_2 .... markerN alleleN_1 alleleN_2
          >>| they tell me there can be upto 1400 markers per individual. I could
          >>| make the markers a 1 to many table and add a way to associate them to the
          >>| alleles, but that still leaves me at about 2800+ column. hope this sheds
          >>| some light on what you asked? thanks.[/color]
          >
          > How about:
          > table Marker
          > PKMarkerID int(11) auto-increment
          > <other data fields>
          >
          >
          > Table Alleles
          > fkMarkerID int(11)
          > alleleNbr int(10) unsigned
          > alleleValue int(11)
          >
          > This would store the data in the most efficient method.
          > Later on you could retrieve selective information like:
          > SELECT *
          > FROM Alleles
          > WHERE alleleNbr = 10 and alleleValue between 50 and 100;
          > ---------------------------------------------------------------
          > jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
          > ---------------------------------------------------------------[/color]

          Comment

          • Jeff North

            #6
            Re: db/table design question

            On Thu, 31 Mar 2005 10:20:45 -0800, in mailing.databas e.mysql G
            <nospam@nospam. org> wrote:
            [color=blue]
            >| yes, the more I think about this the better it sounds.
            >| when i start developing with it it may get trickier.
            >| having it all horizontal made for easy 'order by's for
            >| the web, but you have to give up somethings. thanks, g.[/color]

            Not really, you need to create a cross-tab query.
            http://dev.mysql.com/tech-resources/...ard/index.html

            [color=blue]
            >| On Thu, 31 Mar 2005 16:00:52 +0000, Jeff North wrote:
            >|
            >| > On Wed, 30 Mar 2005 20:08:33 -0800, in mailing.databas e.mysql G
            >| > <nospam@nospam. org> wrote:
            >| >
            >| >>| i'm working with genetic data and it's composed of
            >| >>| marker1 allele1_1 allele1_2 .... markerN alleleN_1 alleleN_2
            >| >>| they tell me there can be upto 1400 markers per individual. I could
            >| >>| make the markers a 1 to many table and add a way to associate them to the
            >| >>| alleles, but that still leaves me at about 2800+ column. hope this sheds
            >| >>| some light on what you asked? thanks.
            >| >
            >| > How about:
            >| > table Marker
            >| > PKMarkerID int(11) auto-increment
            >| > <other data fields>
            >| >
            >| >
            >| > Table Alleles
            >| > fkMarkerID int(11)
            >| > alleleNbr int(10) unsigned
            >| > alleleValue int(11)
            >| >
            >| > This would store the data in the most efficient method.
            >| > Later on you could retrieve selective information like:
            >| > SELECT *
            >| > FROM Alleles
            >| > WHERE alleleNbr = 10 and alleleValue between 50 and 100;
            >| > ---------------------------------------------------------------
            >| > jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
            >| > ---------------------------------------------------------------[/color]

            ---------------------------------------------------------------
            jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
            ---------------------------------------------------------------

            Comment

            Working...