MySQL Forums
Forum List  »  Newbie

Re: How to force auto-increment field to increase monotonically
Posted by: Austin Einter
Date: April 20, 2011 05:09AM

It really matters.

lets take an use case. Say in a table I have skill-name and skill-id(auto-increment) coulmn.
So a typical look of my table will be

id name
1 skill1
2 skill2
3 etc....
4
10
11
25
26
27
43
44
45

Now if I am going to add more number of skills , the id coulmn will reach faster to maximum value of integer, thereny next insert will fail.

So either at SQL level, or at program level (using PHP) or whatever, we need to make sure, the id coulmn should increment monotonically, else we will endup facing false insert operations.

Austin



Edited 1 time(s). Last edit at 04/20/2011 05:10AM by Austin Einter.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.