开发者

What if I need a very very big autoincrement ID?

开发者 https://www.devze.com 2023-02-28 00:40 出处:网络
According to t开发者_StackOverflowhe MySQL website, the signed bigint can go up to 18446744073709551615.

According to t开发者_StackOverflowhe MySQL website, the signed bigint can go up to 18446744073709551615. What if I need a number bigger than that for the auto-incrementing primary key?


If you insert 1 million records per second 24x7, it will take 584542 years to reach the limit.

I hope by then a next version of MySQL will support bigger ID columns :)


With such a number (1 to 18446744073709551615), you can give all the animals on the earth a unique ID :)


I suppose you're screwed? You could get rid of MySQL's auto increment and could use a base 64 number you increment yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消