From: Dan Nelson Date: November 17 2001 8:02pm Subject: Re: width and height performance List-Archive: http://lists.mysql.com/mysql/91587 Message-Id: <20011117200257.GA15078@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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