Brian Aker <[email protected]> writes: > Auto-increments have always had a set behavior... some of this worked > well, and some of it causes bottlenecks. > > 1) They always increase in value in the table. You can use them as a > "what came before what". > 2) Gaps don't (for the most part) exist). > > What are people's feelings about the above assumptions? Is it ok to
I think it is ok to break them. They are probably invalid one way or the other in different engines, and as we move to higher concurrency, distributed databases, they get harder and harder to maintain. To me, AUTO_INCREMENT just means "give me a unique id with minimal fuss, I don't care about the value". Also don't forget the MyISAM (and previously BDB) feature of having AUTO_INCREMENT on a secondary column. So you can have primary key (user_id, message_id) with AUTO_INCREMENT on message id, and each user will have message_id's 1,2,3,... (possibly with holes). I think that is actually more useful, as you very often want this in order to cluster/shard your data on user id (or whatever). And it would be great to have InnoDB and other engines support this as well. - Kristian. _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

