Category: unique

Declaring an Index as unique in SQL Server

If I know an index will have unique values, how will it affect performance on inserts or selects if I declare it as such. If the optimiser knows the index is unique how will that affect the query plan? I understand that specifying uniquenes can serve to preserve integrity, but leaving that discussion aside for […]

.NET unique object identifier

Is there a way of getting a unique identifier of an instance? GetHashCode() is the same for the two references pointing to the same instance. However, two different instances can (quite easily) get the same hash code: Hashtable hashCodesSeen = new Hashtable(); LinkedList<object> l = new LinkedList<object>(); int n = 0; while (true) { object […]