如果我需要一个非常大的自动增量ID怎么办? [英] What if I need a very very big autoincrement ID?
本文介绍了如果我需要一个非常大的自动增量ID怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
根据MySQL网站,已签名的bigint最多可以达到18446744073709551615. 如果我需要一个比自动递增主键更大的数字怎么办?
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?
推荐答案
如果每秒24x7插入100万条记录,则需要584542年才能达到极限.
If you insert 1 million records per second 24x7, it will take 584542 years to reach the limit.
我希望届时MySQL的下一版本将支持更大的ID列,并且开发人员在发布到StackOverflow之前,都将能够进行信封后的计算:)
I hope by then a next version of MySQL will support bigger ID columns, and developers will all be able to do back-of-the-envelope calculations before posting to Stack Overflow :)
这篇关于如果我需要一个非常大的自动增量ID怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文