Primary key id reaching limit of bigint data type

后端 未结 4 1515
星月不相逢
星月不相逢 2020-12-31 23:18

I have a table that is exposed to large inserts and deletes on a regular basis (and because of this there are large gaps in the number sequence of the primary id column). It

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 23:27

    If you don't need that column because you have another identifier for a record which is unique. Like a supplied measurement_id or whatever or even a combined key: measurement_id + location_id it should not be needed to use an auto increment key. If there is any chance you won't have a unique key than make one for sure.

    What if I need a very very big autoincrement ID?

    Are you really sure you have so many inserts and deletes you will get to the limit?

提交回复
热议问题