Native primary key or auto generated one?

后端 未结 6 1430
无人共我
无人共我 2020-12-19 11:38

As a rule is it better to use native primary keys (ie existing columns or combination of columns) or set your primary key to an auto generating row of integers?

6条回答
  •  遥遥无期
    2020-12-19 12:16

    I would say auto generating, theres no real reason not to in my mind. Unless your developing some kind of hash table, but even so, I would stick to a unique primary key automatically created by the database. Its quick, simple and reliable. Don't reinvent the wheel if its already there.

提交回复
热议问题