Database Design: A proper table design for large number of column values.
Posted
by Jake
on Stack Overflow
See other posts from Stack Overflow
or by Jake
Published on 2008-10-03T20:48:01Z
Indexed on
2010/05/02
1:27 UTC
Read the original article
Hit count: 300
database-design
I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...?
Option 1
Have a table with 1000 columns. Seems like a bad idea. What if the number of statistics one day exceeds the maximum number of columns?
Option 2
Have a table with three columns. Let's say, ID, StatisticType, and StatisticValue. That way, you can have as many statistics as you want. However, reading a single experiments statistics becomes more complicated. Moreover, what if different statistics are different data types??
Any suggestions?
© Stack Overflow or respective owner