MySQL – Does AutoIncrement ID Degrade Performance?

MySQL

I have a big table with ID column set as bigint auto_increment. At some time in history we decided to generate IDs on client side as some pseudo-random number.

My question is simple: given that the table column is still set as auto_increment, does this affect performance negatively even though we ALWAYS supply ID in INSERT queries? Is this significant/should I bother to change the schema? The table is EXTREMELY huge and busy, I am afraid I cannot do this without downtime.

Best Answer

After statically looking at the MySQL (5.7.28) code it makes no difference. Auto_increment locks within innodb only happen if fetching a new auto_increment value (via here), or altering the table to have a different auto_increment value.

Its current dormant status is not causing any impact to you.