Reasons not to use an auto-incrementing number for a primary key

前端 未结 16 2654
南旧
南旧 2020-12-29 06:02

I\'m currently working on someone else\'s database where the primary keys are generated via a lookup table which contains a list of table names and the last primary key used

16条回答
  •  自闭症患者
    2020-12-29 06:31

    My main issue with auto-incrementing keys is that they lack any meaning.

    For tables where certain fields provide uniqueness (whether alone or in combination with another), I'd opt for using that instead.

提交回复
热议问题