Artist Kampong
Artist Kampong

Reputation: 161

What if I need a very very big autoincrement ID?

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?

Upvotes: 16

Views: 12481

Answers (3)

9000
9000

Reputation: 40884

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

Upvotes: 105

Sourav
Sourav

Reputation: 17530

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

Upvotes: 17

Jess
Jess

Reputation: 8700

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

Upvotes: 2

Related Questions