整数溢出下一步将是什么 [英] Integer overflow what will be next
问题描述
我现在使用int(22)
作为我的表格字段.但是现在它的值2147483647
溢出并停止,所以我的 3000字段使用了相同的ID .我真的很坚持
现在我用bigint(20)
unsigned 进行了更改,但将来可能会遇到相同的情况.
请告诉我什么将更好地用于此
varchar
或bigint
或任何
如果我得到一些解释,那也很好.
这样想:填满INT
花了多长时间?大概六个月?
如果您以相同的速率插入数据,这就是填充BIGINT
所花费的时间.因此,如果您花了半年的时间来填充INT
,则BIGINT
将持续20亿年.
这为您提供了一个范围,使BIGINT
的范围比INT
大得多. BIGINT
最多支持2 64 个值,这是INT
中的值数量的2 32 倍.
I am using int(22)
for now as my table field. but for now it's overflow with value 2147483647
and stop so my 3000 field gone the same id. I am really stuck with that
For now i changed it with bigint(20)
unsigned but may be i will come same condition in future.
Please advice me what will be better use for this
varchar
or bigint
or any
Also would be great if i get some explanation.
Think of it this way: how long did it take you to fill up an INT
? Perhaps six months?
Now multiply that time by roughly 4 billion.
That's how long it will take to fill up a BIGINT
, if you insert data at the same rate. So if it took you half a year to fill an INT
, the BIGINT
will last 2 billion years.
That gives you some scope of how much larger the range of a BIGINT
is than an INT
. A BIGINT
supports up to 264 values, which is 232 times larger than the number of values in an INT
.
这篇关于整数溢出下一步将是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!