Performance impact of Composite Unique Constrain(on a lot of columns)
<p>Say that I have a table which I don't want duplicate rows in it.</p>

<p>To avoid equality check, I plan to create a unique index on <strong>MOST (if not all) of the columns</strong>. And in my application I can madly insert the records regardless the equality. Besides some basic query, I don't have any particular performance requirement for this table.</p>

<p>My question is:</p>

<ol>
<li>Is it a bad practice(to create unique index for this kind of purpose only)? </li>
<li>If so, what the impact would be?</li>
<li>Alternatives? (I can manually hash it and put it along with the hash code, and create a unique index on this single column. However I don't think it is a smart move either.)</li>
</ol>

<p>BTW, I'm using MySQL if it is DB Engine related issue, although I'm interested to a general explanation. </p>

<p>Thanks!</p>