|
|
|
|
|
by dnewcome
5277 days ago
|
|
I've got to push back on the anti-guid stance for surrogate keys. They may be big but it is nice to have opaque IDs so that no one makes flawed assumptions about ordering or relative insertion time/trying to guess valid IDs, etc. Opaque is good... |
|
The other problem with guids is that if you cluster on a guid, then whenever you do inserts, you're inserting the data into random spots in the table. You end up fragmenting the bejeezus out of the table, doing page splits like crazy. If you defrag the table/indexes, you'll be right back where you started within a few days of doing inserts.
That penalty isn't immediately obvious in small environments, but by the time you're big enough to have performance problems and you call in a consultant, it's going to be an ugly discussion with management. "Hey, wish I could help you, but..." Don't get me wrong, that's not always the biggest bottleneck, but it makes for some awkward discussions.