Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many fields is 'too many' in a table?

Tags:

I have a coworker who is planning a database for a new app that will have several tables with over 30 fields each. Is this excessive? Maybe I'm just not enterprisey enough to understand.

Edit: Also, a lot of the fields are option-type sort of things (like on a request form, would you like your widget to be yellow or green, he has a field for 'colour' with an enum). It's quite likely that these will be added to or removed over time. I haven't really done database design and try to stay away from it myself, so maybe I'm being completely stupid, but surely there's a better way of doing this??

like image 884
franzferdinand Avatar asked Oct 21 '08 02:10

franzferdinand


People also ask

How many fields is too many?

In Access, you can define up to 255 fields in a table. If you create 255 fields and then delete 10, Access does not release the fields from the internal column count. Also, for every field whose properties you modify, Access creates a new field and does not release the original field from the internal column count.

How many columns in a table is too many?

There isn't a number that's too many. That said, it sounds like, based on your description, that you're not dealing with a properly structured table. 180 columns to define a user and 280 columns to define a thing... That can't possibly be normalized or a fact table.

How many fields can a table have?

Aside from the sanity of it, what if any is the technical impact of just adding more and more fields? Hi Shane, Technically, MySQL can handle up to 64K (65,535) fields on a table.


1 Answers

The most obvious sign a table requires normalization that I've seen is fields ending with integers: CouponCode1, CouponCode2, CouponCode3.. you get the point. There will be exceptions to the rule as always though.

like image 114
Chris Missal Avatar answered Oct 22 '22 23:10

Chris Missal