Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

Denormalization to allow use UNQIUE index? (6 replies)

$
0
0
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?

Viewing all articles
Browse latest Browse all 1957

Trending Articles