Skip to main content
Known Participant
September 18, 2008
Question

One table or many?

  • September 18, 2008
  • 5 replies
  • 684 views
I'm just starting to re-write a web app and looking at the database one of the tables is getting quite large (field wise)

The table in question is for room attributes but is used in 3 different apps. It's not particularly large in either direction and isn't high demand on records so I suspect the overall answer to this is in this case it doesn't matter but I'd be interested in people's thoughts.

Do i have one large table with approx 90 fields which has less query load as I'm not joining tables so much or do i have 3 tables (one for the basic room details (5-10 fields) one with the equipment in the room (30 fields) etc. which would need joining each time I used them but would be easier for writing queries as select * would be appropriate most of the time and would arguably be easier to maintain and modify (for both db and queries)?

The floor is now open!

This topic has been closed for replies.

5 replies

Inspiring
September 18, 2008
Code keystrokes are the least important factor. The database has to meet the business needs of the application. Next, it should be as efficient as possible.

Plus your current schema is not normalized if you have 30 fields for equipment in a room. What happens when you want to add the 31st item?
Known Participant
September 18, 2008
I agree, but I still need to rewrite it a bit anyway
Participating Frequently
September 18, 2008
If it ain't broke......
Known Participant
September 18, 2008
The data is all normalised - it's mainly check boxes and IDs for joins. The table joins to others for all the useful information.

There's no particular reason for me to go one way or the other, purely convenience.
Participating Frequently
September 18, 2008
Wow, hard to answer. What about your data model? Do you have data in your table that is not normalized? Single table "spreadsheet-like" database tables are an indicator of a missing or inadequate data model and design. However, it is almost impossible to know for sure without knowing the nature of your data, how your entities relate, and what attributes are associated with these entities, etc.

Phil