Dark57 Posted April 21, 2010 Share Posted April 21, 2010 So I'm looking to use a database to store many different fields of information. I'm looking at roughly 20 or more columns of information per user just at the start, before I start getting into other systems I may implement in the future. My question is, would it be easier to manage all of this information in multiple tables or in one huge table. Whats the downside to using one huge table and the downside of multiple tables. Will either of these slow down the website or use more bandwidth? EDIT: Actually, now that I think about it this should probably be in the MYSQL section. Quote Link to comment https://forums.phpfreaks.com/topic/199319-database-questiondiscussion/ Share on other sites More sharing options...
litebearer Posted April 21, 2010 Share Posted April 21, 2010 might start here... http://www.devshed.com/c/a/MySQL/An-Introduction-to-Database-Normalization/ Quote Link to comment https://forums.phpfreaks.com/topic/199319-database-questiondiscussion/#findComment-1046101 Share on other sites More sharing options...
Dark57 Posted April 21, 2010 Author Share Posted April 21, 2010 Yeah well I said its a question/discussion because I'd like to hear from peoples personal experience. Thanks for the link though, I will read it. Quote Link to comment https://forums.phpfreaks.com/topic/199319-database-questiondiscussion/#findComment-1046106 Share on other sites More sharing options...
ignace Posted April 21, 2010 Share Posted April 21, 2010 The best practice is to use multiple tables as it 1) separates the data in ordered groups 2) removes overhead (when you enter product info you don't want to specify a new user) 3) searches are faster (even if not indexed) as the data is in smaller chunks (1000 products, 10 users would search through 1010 rows upon user login while it would search through only 10 rows if contained in it's own separate table). Reason number 2 should be enough to convince you to create multiple tables and properly normalize your database. EDIT: Actually, now that I think about it this should probably be in the MYSQL section. Good thinking. Quote Link to comment https://forums.phpfreaks.com/topic/199319-database-questiondiscussion/#findComment-1046125 Share on other sites More sharing options...
Dark57 Posted April 21, 2010 Author Share Posted April 21, 2010 Ok I do see the logic behind creating multiple tables inside a database. I am reading up on normalizing it and it makes sense, now I will just have to take it to the drawing board so I can break it down into tables that make sense. Quote Link to comment https://forums.phpfreaks.com/topic/199319-database-questiondiscussion/#findComment-1046127 Share on other sites More sharing options...
DavidAM Posted April 21, 2010 Share Posted April 21, 2010 Or, you could continue this discussion by describing the "columns" of data you are proposing and we can help you break it up into tables, if necessary. ignace's statement to use multiple tables may or may not be correct. If all of the columns are specific data about the user, a single table could be appropriate. If the columns include products purchased or other data not specific to the user, then there are multiple tables in the database. However, I can easily see a user table with 20 or more columns of user-specific data. Without knowing what the proposed data elements are, and the proposed system, we can't really answer the question. Ordinarily, there should be one AND ONLY one USER table with each user listed in that table. Quote Link to comment https://forums.phpfreaks.com/topic/199319-database-questiondiscussion/#findComment-1046143 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.