Isn't INT more efficient than UNIQUEIDENTIFIER?
- by ck
I have a parent table and child table where the columns that join them together are the UNIQUEIDENTIFIER type.
The child table has a clustered index on the column that joins it to the parent table (its PK, which is also clustered).
I have created a copy of both of these tables but changed the relationship columns to be INTs instead, have rebuilt the indexes so that they are essentially the same structure and can be queried in the same way.
When I query for a known 20 records from the parent table, pulling in all the related records from the child tables, I get identical query costs across both, i.e. 50/50 cost for the batches.
If this is true, then my giant project to change all of the tables like this appears to be pointless, other than speeding up inserts. Can anyone provide any light on the situation?