Are there any disadvantages to having many-column tables
database, database-design, mysql
Solution
It isn't so much the number of columns that makes a design unfortunate. It's whether all those columns really belong in that same table. The data normalization rules have much to say about the consequence of storing data in one table when the data is not tightly related to the key of the table.
It behooves you to learn the normalization rules and what happens when you don't follow them At some later time, it may also behoove you to learn of cases where deliberate departure from normalization rules may result in a good design. But you can't learn that until after you have come up to speed on the value of normalizing your table design.
Problem
I'm planning a database structure which is going to store quite a bit of data. We need to store 50 different 'columns' of data for each item. Adding a timestamp, that gives us 52 columns (and 2 indexes which will be the only way this data is going to be filtered). This database will get a few thousand rows added every day (and never updated), and will be in use for a while. So my first choice was to shove everything into one table. Got me thinking whether 52 columns is somehow bad or something? I never gave it much thought. Granted the insert code will be irritating but its not like I'm going to write them by hand. Should I split it into a number of tables (then use Joins or something?), or is there no issue with having tables that large? If it makes a difference I'm using mysql. ADDED: To make a clarification on how I'll be using the data: - Sorting and filtering will ONLY be done on indexed columns. - The data will be used for 'human consumption' at present plans, so we'll always be accessing the entire row (outputting it to a csv or whatever when needed). - There will be no deletes or updates. There will be a lot of Inserts, and (less frequently) Selects. - There will be no 'linking' (foreign keys or whatever) of any sorts with other data in the database - All the data relates to the same thing. There's no 'obvious' way to normalise it, and breaking it into tables would just put categories of sorts into the data and storing them like that.