Bug #5586 | Suggestions relating to autonumber data type | ||
---|---|---|---|
Submitted: | 15 Sep 2004 7:39 | Modified: | 23 Jan 2006 12:11 |
Reporter: | keith allpress | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server | Severity: | S4 (Feature request) |
Version: | OS: | ||
Assigned to: | CPU Architecture: | Any |
[15 Sep 2004 7:39]
keith allpress
[15 Sep 2004 10:45]
Federico Razzoli
I agree that better autonumber are needed, but I have a different suggestion. I think that AUTOINCREMENT columns should remain as they are (because they are very fast and for backward compatibility) but you should implement SEQUENCEs. SEQUENCEs are standard and very flexable, because you can have loops, steps different from 1, etc. Are SEQUENCEs already on your to-do?
[15 Sep 2004 11:56]
keith allpress
I dont see how additional features necessarily break backward compatibility of existing features.
[23 Jan 2006 12:11]
Valeriy Kravchuk
Thank you for a feature request. Please, read the manual (http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html) about auto_increment. It explains that your suggestion #2 is already implemented for MyISAM and BDB storage engines. > 1. The restriction exists that there can only be one autonumber column and > it must be defined as a primary key. It should be indexed, not primary key. As for several autonumbering columns, never seen that in any RDBMS. > 3. Unique random numbers are preferable to autonumbered values whenever > meaningless surrogate key values are required, so the suggestion is to > define a novel unique_random data type extension. This is also uncommon feature for a database. This feature (random surrogate key) should be implemented in those applications that need it. By that way, randomness and uniqueness are mutual exclusive concepts... Support for sequences (in Oracle sense) is a different story. I believe, sequences will be supported in MySQL some day. They really allow to solve at least probplems #1 and #2 you had pointed out.