Sample Header Ad - 728x90

MySQL: Why is auto_increment limited to just primary keys?

13 votes
5 answers
44063 views
I know MySQL limits auto_increment columns to primary keys. Why is this? My first thought is that it's a performance restriction, since there probably is some counter table somewhere that must be locked in order to get this value. Why can't I have multiple auto_increment columns in the same table? Thanks.
Asked by Christopher Armstrong (535 rep)
Jun 23, 2011, 07:45 PM
Last activity: Sep 28, 2023, 10:49 AM