Is it OK not to use a Primary Key When I don't Need one

前端 未结 12 1478
南笙
南笙 2020-12-17 23:06

If I don\'t need a primary key should I not add one to the database?

12条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 23:27

    A primary key will always help with query performance. So if you ever need to query using the "key" to a "foreign key", or used as lookup then yes, craete a foreign key.

提交回复
热议问题