Resetting AUTO_INCREMENT is taking a long time in MySQL

后端 未结 2 891
星月不相逢
星月不相逢 2021-01-18 03:10
ALTER TABLE tablename AUTO_INCREMENT = 10000000

This query is taking long time to update. Why? I need to optimize this query.

2条回答
  •  星月不相逢
    2021-01-18 04:08

    user and admin data must be distinguished not by id, but by another field. If you would treat an id as an abstract identifier with no other meanings it will save you a lot of time and resources, trust me.

提交回复
热议问题