Re: Storing blog posts and comments issue
Posted by: Rick James
Date: January 19, 2009 12:09AM

Comments and Posts are the bulky things, right? Store each only once, and have a unique id for the comment/post.

Then, in other tables, reference these id(s) as needed to build the hierarchy. If there is no comment, you can use null or 0.

It may be more practical to have the "id" assigned when you store the meta information. Then that id would be used as the primary key into the comment/post table. If there is no comment, there would be no row. For the SELECT, you do a LEFT JOIN do get the comment or get NULL.

Best practice issues...
* Blobs, names, etc show up only once, with ids being surrogates for them ("normalziation")
* Ids tended to show up in multiple tables.
* Dates -- I argue against 'normalizing' them.

Options: ReplyQuote


Subject
Written By
Posted
Re: Storing blog posts and comments issue
January 19, 2009 12:09AM


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.