MySQL Forums
Forum List  »  InnoDB

Denormalization to allow use UNQIUE index?
Posted by: Victor Porton
Date: November 11, 2016 09:34AM

Post has many Comment. Post contain issue_id field and Comment contains comment_id field. The request to create a comment with (issue_id, comment_id) which already exists in the DB should be ignored. Is it worth to add a copy of post_id into Comment (in order to use UNIQUE index to prevent duplicates)? Or should I use transactions?

That is, is denormalization worth the possibility to easily create composite UNIQUE?

--
http://freesoft.portonvictor.org

Options: ReplyQuote


Subject
Views
Written By
Posted
Denormalization to allow use UNQIUE index?
648
November 11, 2016 09:34AM


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.