Is it ok to use character values for primary keys?

前端 未结 7 1147
悲&欢浪女
悲&欢浪女 2021-01-19 10:54

Is there a performance gain or best practice when it comes to using unique, numeric ID fields in a database table compared to using character-based ones?

For instanc

7条回答
  •  猫巷女王i
    2021-01-19 11:04

    Are you talking about your primary key or your clustered index? Your clustered index should be the column which you will use to uniquely identify that row by most often. It also defines the logical ordering of the rows in your table. The clustered index will almost always be your primary key, but there are circumstances where they can be differant.

提交回复
热议问题