Is there an advantage to this type of one-to-one relationship?

Thread Solved
Reply

Join Date: Jun 2009
Posts: 14
Reputation: gnobber is an unknown quantity at this point 
Solved Threads: 0
gnobber gnobber is offline Offline
Newbie Poster

Is there an advantage to this type of one-to-one relationship?

 
0
  #1
Jun 16th, 2009
Hi,

I just would like to ask if there is a benefit regarding this type of relationship between tables. Say I have a table named Student. I usually relate a table (one-to-one) to extend it. What I mean is so as to not put too much columns in Student table (and for organization), I typically relate a one-to-one relationship like this:

[Student.General] ---> [Student.Contact]
|
|--------------> [Student.Parent]
|
|--------------> [Etc.]

I distribute some other fields to other tables. I know this will be slower to query, but is there a performance impact for tables with lots of fields. And I also tend to do this so I can read data easier. What are some guidelines for no. of fields in a table? Thanks!
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 304
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: Is there an advantage to this type of one-to-one relationship?

 
0
  #2
Jun 16th, 2009
I would say that the number of fields in a table has very little impact on database performance. I don't think you will notice a difference between the query speed of a table with just a few fields and a table with many fields. However, there is a limit on how many fields a table can have. For example, in MS Access, I don't think you can have more than 255 fields in a table. Other database managements systems, such as mySQL, support more fields.

Here is a link to a discussion about this topic:
http://www.codingforums.com/archive/...p/t-48570.html
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 40
Reputation: xpartmgr is an unknown quantity at this point 
Solved Threads: 4
xpartmgr xpartmgr is offline Offline
Light Poster

Re: Is there an advantage to this type of one-to-one relationship?

 
0
  #3
Jun 19th, 2009
Well I understand that for a normalized DB this would not be much help. Look at this:

One-to-one relations

Normalization will never generate two tables with a one-to-one relationship between them. There is no theoretical reason to separate a single entity like this with some fields in a single record of one table and others in a single record of another table but you might want to split a table into two for practical reasons in order to:

* reduce the number of fields in a table and meet some limit in the programming language.
* store large and rarely-used fields in a separate table so that you do not waste time transferring and processing them during routine operations.
* separate sensitive information from commonly-used fields so that the tables can be stored and backed-up separately.

Since I'm no expert take my comments as such.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Database Design Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC