When inserting a guid as a primary key does the db server go through every single row to make sure there’s no duplicate or does it just assume that a duplicate is not possible or very unlikely?
with int the db server can simply increment the key but not the case with GUIDs
That’s the databases responsibility once you tell it that a column is a primary key.
It’s nothing that you have to be concerned with at this point, let the database worry about this for you.
Also, since this is a primary key it’s going to be indexed. So your preformance concern about going though each row (or a table scan) would not really occur at this level. The database would use the index file to ensure that only a unique value could be inserted.