I forgot to mention for my proposition one has to store the last number update set last_number= last_number+1 .... locks the table
I forgot to mention
for my proposition one has to store the last number
update set last_number= last_number+1 ....
locks the table