Consider a simple table with an auto-increment column like this:
CREATE TABLE foo ( `fooid` bigint unsigned NOT NULL auto_increment, ....snipped.... other columns PRIMARY KEY (`fooid`) ) ENGINE=InnoDB AUTO_INCREMENT=10
How does one redesign this so that we don't hit the max of the bigint datatype ? The unsigned range is 0 to 18446744073709551615. I don't know how long it will take to reach 18446744073709551615, but like the Y2K problem, I want to be ready for it.
Suppose you insert one row every millisecond.
18446744073709551615 millseconds = 18446744073709552 seconds = 307445734561826 minutes = 5124095576030 hours = 213503982335 days = 584942417 years
So it's not really like the Y2K problem
You could insert a million rows per millisecond and still be okay for over 500 years.
In other words: don't worry about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With