MySQL Forums :: InnoDB :: Denormalization to allow use UNQIUE index?


Advanced Search

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? 451 Victor Porton 11/11/2016 09:34AM
Re: Denormalization to allow use UNQIUE index? 229 Peter Brawley 11/11/2016 11:49AM
Re: Denormalization to allow use UNQIUE index? 221 Victor Porton 11/11/2016 01:02PM
Re: Denormalization to allow use UNQIUE index? 226 Peter Brawley 11/12/2016 01:25PM
Re: Denormalization to allow use UNQIUE index? 298 Victor Porton 11/12/2016 02:14PM
Re: Denormalization to allow use UNQIUE index? 215 Rick James 11/12/2016 05:38PM
Re: Denormalization to allow use UNQIUE index? 207 Peter Brawley 11/12/2016 06:30PM


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.