List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:November 17 2001 8:02pm
Subject:Re: width and height performance
View as plain text  
In the last episode (Nov 17), florian said:
> i have to store a dataset of 20  elements. the data is a int(1). i
> would have about 800 000 datasets. now the question is what performs
> better with mysql?
> 
> one table like this:              or:
> 
> mytable                           mytable
> ----------                        ----------
> someId                            someId
> element1 int(1)                   elementNum int(2)
> ...                               elementValue int(1)
> element20                         ----------
> ----------
> 
> is it better to have 800 000 rows with 21 columns or 160 000 000 rows 
> with 3 columns?

The 21-column one.  Especially if every row has all 20 elements
populated.  The 2nd option is better for layouts where you want to
dynamically add or remove elements, and where each row only has a
couple of elements.

-- 
	Dan Nelson
	dnelson@stripped
Thread
width and height performanceflorian17 Nov
  • Re: width and height performanceDan Nelson17 Nov
  • Re: width and height performanceCarl Troein17 Nov