|
|
|
|
|
by BrentOzar
5277 days ago
|
|
The size of guids isn't the only challenge. (The size is a little trickier than it looks, too - remember that the guid will be included in every index so the database can find its way back to the clustered index.) 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. |
|