Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > General > Database Concepts & Design > 4NF Data Redundancy Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-04, 01:34
adamr adamr is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
4NF Data Redundancy Problem

I am designing a database that is very similar to the situtation described by the following link at PHP Builder.net:

http://www.phpbuilder.com/columns/ba...31.php3?page=5

Basically, we want many URLs. associated with many UserIDs. At the point that 4NF is achieved, the url_relations table holds unique relationships between users and their URLs.

Q: Is this a flawed design, since the database can become overwhelming when holding so many unique relationships between users and their URLs? Imagine if you have 100 users, each associated with 50 different URLID's. It's my understanding that this can lead to 5000 rows.

What is the best way to deal with this kind of situation?

Thanks in advance for your time and help. If my situation hasn't been explained well enough, I'll be happy to elaborate.
Reply With Quote
  #2 (permalink)  
Old 03-29-04, 04:56
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,007
Re: 4NF Data Redundancy Problem

Imagine, 5000 rows! ;-)

Don't worry, 5000 rows is chicken feed for a database. 5 million is commonplace, 5 billion is large. (Unless you are using something like Access which is barely a DBMS at all.)

Anyway, what is the alternative? A Users table with 50 columns UrlID1, UrlID2, ...? (No!)
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 03-29-04, 08:33
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 10,135
Without knowing a LOT more about your particular usage/system/etc I can't offer a lot of comment on the overall usefulness, correctness, or completeness of your solution.

As Tony pointed out, five million rows will get a database engine to pay attention to your query. Five thousand is "makework" for most engines.

If your schema works for you (and your use of the term 4NF makes me think that it will), the databse engine should happily chew through it with gusto!

-PatP

Edited to correct a minor bone-head on my part. I was talking to one person, and typing about a different person, and confused the names!

Last edited by Pat Phelan : 03-29-04 at 08:35.
Reply With Quote
  #4 (permalink)  
Old 03-29-04, 10:25
MattR MattR is offline
Registered User
 
Join Date: Mar 2001
Location: Lexington, KY
Posts: 606
However -- in that example they have a RelationID -- this is superfluous and should not be included in your design.
__________________
Thanks,

Matt
Reply With Quote
  #5 (permalink)  
Old 03-29-04, 10:49
adamr adamr is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
I appreciate all of your help, you hit the nail right on the head...I really didn't have an idea as to the characteristic sizes of a small/medium/large database.

I'll also take MattR's advice, and take out the relationID.

Thanks again for your attention,
Adam
Reply With Quote
  #6 (permalink)  
Old 03-29-04, 10:53
MattR MattR is offline
Registered User
 
Join Date: Mar 2001
Location: Lexington, KY
Posts: 606
Make sure you set the primary key to be:
(relatedUserId, relatedUrlId)
__________________
Thanks,

Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On