I just generally go with the 'auto_incrementing' field for unique ID's. You can generally use a pretty big numbers for the field, with unsigned int you get up to 4000000000 plus before you get near the edge!
As for checking the last value and doing some calculations for the next value IMHO, you are just re-inventing the wheel when auto_inc does it already? Also there may be concerns in a multi threaded system with duplicate values being created if for example over an internet connection the last value is read, next user gets the same last value, system generates next value the same for both users, both write the same value as the identifier? auto _inc retains integrity.
You may be able to trim a few k off the database with your own routines to manage unique i.d's, but you add extra processing time? 4billion plus ad's would be nice I guess, but in reality will this ever run out?
/* measure twice, cut once */