MySQL Forums
Forum List  »  Newbie

Re: Database model - confusion
Posted by: Roland Bouman
Date: August 03, 2005 02:06PM

Well if you plan on having hierarchies, check out this thread:

http://forums.mysql.com/read.php?10,32818,32818#msg-32818

and this article mentioned there by Erin

http://www.vbmysql.com/articles/managing-hierarchical-data-in-mysql.html

Short version here: The structure you describe is capable of storing the hierachies just fine, and it is totally non-redundant, which is fine - when you are adding or updating data. When you are querying data, it's generally not a pleasant solution.
Problems generally arise in case you want to peek up or down a arbitrary number of levels from some node in the hierarchy. MySQL does not have language construct to deal with this, and in say Oracle, which does support it (CONNECT BY), it's still subject to lot's of restrictions.
Good news is, it can all be avoided, at the expense maintaining some redundancy. This will give you a slightly harder time maintaining integrity whilst inserting, updating and deleting. How? read that in the article.

Options: ReplyQuote


Subject
Written By
Posted
July 31, 2005 12:40AM
July 31, 2005 03:45PM
August 01, 2005 03:41PM
August 01, 2005 03:46PM
August 02, 2005 03:57PM
August 03, 2005 01:51PM
Re: Database model - confusion
August 03, 2005 02:06PM
August 04, 2005 01:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.