Karaethon Posted March 23, 2019 Share Posted March 23, 2019 What happens when auto incement maxes out? in my db my auto increment field is int(11) so i know it won't happen soon BUT it will happen because this table is filled with script generated data, some is alive but older data will be expired. Since the old data is un-needed should I delete it? If deleted will auto-increment 'roll over' and start at the first number again? Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/ Share on other sites More sharing options...
Barand Posted March 23, 2019 Share Posted March 23, 2019 It will go back to 0. If it really worries you you can move to BIGINT UNSIGNED. Then, if you add 1,000,000 records every second it will take 584,942 years to run out of ids. Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/#findComment-1565550 Share on other sites More sharing options...
Karaethon Posted March 23, 2019 Author Share Posted March 23, 2019 38 minutes ago, Barand said: It will go back to 0. If it really worries you you can move to BIGINT UNSIGNED. Then, if you add 1,000,000 records every second it will take 584,942 years to run out of ids. ok, wasnt sure what happened. Not really worried 99,999,999,999 records will take a long time to fill, but i was thinking about the long game. Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/#findComment-1565552 Share on other sites More sharing options...
Barand Posted March 23, 2019 Share Posted March 23, 2019 99,999,999,999 ? Maximum unsigned int is 4,294,967,295 Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/#findComment-1565556 Share on other sites More sharing options...
Karaethon Posted March 23, 2019 Author Share Posted March 23, 2019 1 minute ago, Barand said: 99,999,999,999 ? Maximum unsigned int is 4,294,967,295 oh, well, i was going off an 11 digit number Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/#findComment-1565557 Share on other sites More sharing options...
Barand Posted March 23, 2019 Share Posted March 23, 2019 see mysql integer types Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/#findComment-1565558 Share on other sites More sharing options...
Karaethon Posted March 23, 2019 Author Share Posted March 23, 2019 Yeah, I sorta knew about that, i just wrote that fast, didn't think about actual limit Quote Link to comment https://forums.phpfreaks.com/topic/308508-auto-increment-question/#findComment-1565560 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.