sql - Do clustered indexes have to be unique? -


what happens if clustered index not unique? can lead bad performance because inserted rows flow "overflow" page of sorts?

is "made" unique , if how? best way make unique?

i asking because using clustered index divide table in logical parts, performance so-so, , got the advice make clustered indexes unique. i'd second opinion on that.

thanks!

they don't have unique encouraged.
haven't encountered scenario yet wanted create ci on non-unique column.

what happens if create ci on non-unique column

if clustered index not unique index, sql server makes duplicate keys unique adding internally generated value called uniqueifier

does lead bad performance?

adding uniqueifier adds overhead in calculating , in storing it.
if overhead noticable depends on several factors.

  • how data table contains.
  • what rate of inserts.
  • how ci used in select (when no covering indexes exist, pretty always).

edit
been pointed out remus in comments, there exist use cases creating non-unique ci reasonable choice. me not having encountered 1 off scenarios merely shows own lack of exposure or competence (pick choice).


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -