Auto_increment values in InnoDB?

前端 未结 5 578
眼角桃花
眼角桃花 2020-12-18 01:00

I\'ve been using InnoDB for a project, and relying on auto_increment. This is not a problem for most of the tables, but for tables with deletion, this might be an issue:

5条回答
  •  不思量自难忘°
    2020-12-18 01:36

    Create another table with a column that remembers the last created Id. This way you don't have to take care of the max values in new tables that have this as foreign key.

提交回复
热议问题