If for example, a user didn't have any interests, if you normalize then you simple wont have a row in the interest table for that user. If you have everything in one massive table, then you will have columns (and apparently a lot of them) that contain just NULL's.
这些表中的 所有是否有 1-to-1关系?例如,每个用户行在 user_stats或 user_levels中是否只有一个对应的行?如果是这样,那么将它们合并到一个表中可能是有意义的。如果关系 不是1 to 1虽然,它可能没有意义的组合(去规范化)他们。
Having them in separate tables vs. one table is probably going to have little effect on performance though unless you have hundreds of thousands or millions of user records. The only real gain you'll get is from simplifying your queries by combining them.
预计到达时间:
如果您的 关心是关于 柱子太多了的,那么考虑一下 what stuff you typically use together and combine those,将其余的留在一个单独的表中(或者如果需要的话,留在几个单独的表中)。
Why not use the same approach Wordpress does by having a users table with basic user information that everyone has and then adding a "user_meta" table that can basically be any key, value pair associated with the user id. So if you need to find all the meta information for the user you could just add that to your query. You would also not always have to add the extra query if not needed for things like logging in. The benefit to this approach also leaves your table open to adding new features to your users such as storing their twitter handle or each individual interest. You also won't have to deal with a maze of associated ID's because you have one table that rules all metadata and you will limit it to only one association instead of 50.
Wordpress specifically does this to allow for features to be added via plugins, therefore allowing for your project to be more scalable and will not require a complete database overhaul if you need to add a new feature.
另一种可能的情况是,您有一组 很少出现列。与其使用一堆空值,不如使用一个单独的表,它与1:1相关,或者更贴切地说“1: 罕见”。然后只在需要这些列时才使用 LEFT JOIN。当需要将 NULL转换为 0时,使用 COALESCE()。 底线: 视情况而定。
Limit 搜索条件 to one table. An INDEX cannot reference columns in different tables, so a WHERE clause that filters on multiple columns might use an index on one table, but then have to work harder to continue the filtering columns in other tables. This issue is especially bad if "ranges" are involved. 底线: 不要将这些列移动到单独的表中。