473,387 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

separate user table with user settings?

42
I'm wondering if its a good idea to separate the user information (name, pass, age ...) and the users settings (notifications, themes ...)?

I guess the real question is if its bad practice to have a lot of columns in one table or if its actually faster? One obvious reason not to have them in the same table is if you want to have dynamic settings which require one insert for each setting but I'm not gonna do that right now.
Feb 5 '10 #1
2 3499
Atli
5,058 Expert 4TB
Hey.

As long as each column remains unique to the user, and remains dependent only on the ID of the user, then I don't see a problem with putting them all in one table.

By that I mean: if your fields are dependent on each other, rather than the user, then they should be split up. For example: if you list a home address, creating "country", "city" and "address" fields would be "wrong". They depend on each other, rather than the user. (A city is dependent on the country, and an address is dependent on the city.) - The correct way here would be to create a separate table for each of the parts and link them to the user using a "cascading" 1:N relationship.

The only other factor would be, as you pointed out: performance. If your extra columns are heavy on rarely used variable-length columns (text, varchar, blob) then your performance might suffer if you include them in a table with other frequently used data (especially if they are all fixed-length). - Reading through a table that contains only fixed-length columns is faster than to search through a table containing variable-length columns. You can often speed up your queries by separating them.

For example, in a forum database, you are likely to get a lot more queries asking for forum overviews, rather than forum posts. In those cases, including the topic's text/description in the same table as the other topic data may not be ideal. By separating the text into another table, leaving only fixed-length data, the queries for the forum overviews may be faster, even though the queries for the topic itself may be a bit slower (by having to include a join).
Feb 5 '10 #2
Gozil
42
Thanks for the reply, this clarified a lot for me.
Feb 7 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: collie | last post by:
i need to create 2 separate cookies in asp to be read later on in asp.net. I need to create an ADMIN cookie and a User cookie. In my database i have a table called users. if the field ACCESS=admin...
3
by: Marc Walgren | last post by:
Greetings I have an ASP application to enter reservations. There are multiple user security settings that require some users to have a restricted list of client in a drop list on a form. I...
3
by: Gary Besta | last post by:
I am trying to add a simple case statement to a stored procedure or user defined function. However when I try and save the function/procedure I get 2 syntax errors. Running the query in query...
5
by: Nathan Bloomfield | last post by:
(Terminology may be incorrect) Is it possible to define a global variable (within a module) through a form or some other means which a user of a database can easily change. i.e. how can a...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
5
by: mabond | last post by:
Hi all This question is one of "theory" rather than a search for the specifics of a solution. I need some pointers as to how to proceed with my project. Here goes. My application allows the...
2
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
3
by: penguin732901 | last post by:
What do experienced programmers find the most efficient way to handle user settings. Currently I have 4 tables which allow various clients to customize my program to work for them,...
3
by: Blasting Cap | last post by:
I am working on a web app that I want to be able to use a separate config file on, in addition to the web.config file that's already working in the application. If I put the following in the...
5
eragon
by: eragon | last post by:
I wrote this function to create a new file when the user posts in my forums, and its not creating a new file, can you help me? this script is not copyrighted as the last one. function...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.