I store various user details in my MySQL database. Originally it was set up in various tables meaning data is linked with UserIds and outputting via sometimes complicated calls to display and manipulate the data as required. Setting up a new system, it almost makes sense to combine all of these tables into one big table of related content.
- Is this going to be a help or hindrance?
- Speed considerations in calling, updating or searching/manipulating?
Here's an example of some of my table structure(s):
- users - UserId, username, email, encrypted password, registration date, ip
- user_details - cookie data, name, address, contact details, affiliation, demographic data
- user_activity - contributions, last online, last viewing
- user_settings - profile display settings
- user_interests - advertising targetable variables
- user_levels - access rights
- user_stats - hits, tallies
Edit: I've upvoted all answers so far, they all have elements that essentially answer my question.
Most of the tables have a 1:1 relationship which was the main reason for denormalising them.
Are there going to be issues if the table spans across 100+ columns when a large portion of these cells are likely to remain empty?