Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What if I need a very very big autoincrement ID?

Tags:

mysql

bigint

According to the 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?

like image 803
Artist Kampong Avatar asked Apr 23 '11 05:04

Artist Kampong


2 Answers

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 :)

like image 60
9000 Avatar answered Sep 30 '22 15:09

9000


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

like image 31
Sourav Avatar answered Sep 30 '22 14:09

Sourav