Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql table field limit

Status
Not open for further replies.

cartic

Programmer
Nov 6, 2003
1
US
Hi,
I am runnig a MySQL database. I would like to create a table that will have somethine like 50 fields. I want to know if this will create a problem in the performance of the database.
An eg of what i am trying to do.
table house has fields like
1 house name
2 house area
3 house location
.
.
.
50 house owner
Please let me know if there is a better way to do this.
 
50 fields aint that many so it shouldn't be a problem. If a lot of fields are left empty on the other side you can also make a second table where you select the information you want en the value

table house
houseid
housename

table housinfo
ihouselineid
ihouseid
ihousetypeid
ihousevalue


in the field housetype you can select the type of info (like houseowner)you are filling in and put the value in the value

it's then also handy to make a
table type
typeid
typedescr

for the select list

as said it's no problem to make 50 fields but if during the process fields have to change or new fields have to be added then the second option requiers no mysql maintenance handling from your part


 
I currently have several tables in one of my DB that have hundreds of fields and haven't noticed a detriment (course, it doesn't have millions of row on it either).
 
I have a table which has 221 fields, and 2.6 million records, its also 4.2 gig in size. seems fine.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top