When I add a primary key to a table that already has data, what does each of these database management systems do?
Do they analyze each and every value of the column to confirm it is unique ? Or do they have some other optimized mechanism ? And if that's the case, what is that mechanism ?