performance penalty of strings as primary keys?

前端 未结 4 1707
旧巷少年郎
旧巷少年郎 2020-12-30 06:42

What would be the performance penalty of using strings as primary keys instead of bigints etc.? String comparison is much more expensive than integer comparison, but on the

4条回答
  •  旧巷少年郎
    2020-12-30 07:26

    In our product we use varchar(32) for primary keys (GUIDs) and we haven't met performance issues of this. Our product is a web site with extreme overload and is critical to be stable. We use SQL Server 2005.

    Edit: In our biggest tables we have more than 3 000 000 records with lots of inserts and selects from them. I think in general, the benefit of migrating to int key will be very low, but the problems while migrating very high.

提交回复
热议问题