It is possible to define non-unique columns as clustered as well as non-clustered indexes. However, SQL Server adds a 4 byte integer to the indexed columns in case of a clustered index, if the column is not defined as unique. This is done to keep the "uniqueness" of the record internally even though two or more records may have the value for that column. Why isn't this integer necessary in case of a non-clustered index?
相关问题
- sql execution latency when assign to a variable
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
- SQL to Parse a Key-Value String
相关文章
- Entity Framework 4.3.1 failing to create (/open) a
- Use savefig in Python with string and iterative in
- Code for inserting data into SQL Server database u
- Accessing an array element when returning from a f
- Delete Every Alternate Row in SQL
- Linux based PHP install connecting to MsSQL Server
- SQL Azure Reset autoincrement
- How do we alias a Sql Server instance name used in
I believe this has to do with the row locator.
Width of the nonclustered index row = Width of the nonclustered index column + Width of the clustered index column = size of column data type + size of column data type.
A non-clustered index already includes the clustered index column so it can reference the exact row that it correlates to. Hence with the uniquifier on the clustered index, the non-clustered index would also include the uniquifier.
A good explanation here: Understanding and Examining the Uniquifier in SQL Server