When we don't need a primary key for our table?

后端 未结 4 824
無奈伤痛
無奈伤痛 2021-02-04 10:06

Will it ever happen that we design a table that doesn\'t need a primary key?

4条回答
  •  庸人自扰
    2021-02-04 10:55

    No.

    The primary key does a lot of stuff behind-the-scenes, even if your application never uses it.

    For example: clustering improves efficiency (because heap tables are a mess).

    Not to mention, if ANYONE ever has to do something on your table that requires pulling a specific row and you don't have a primary key, you are the bad guy.

提交回复
热议问题