开发者

What happens when a table in a database has more rows than the max size of the index data type?

开发者 https://www.devze.com 2022-12-20 06:36 出处:网络
For example if i have a unsigned int in开发者_开发百科dex in my table, what happens when i get more rows than sizeof(unsigned int) ?

For example if i have a unsigned int in开发者_开发百科dex in my table, what happens when i get more rows than sizeof(unsigned int) ? I'm interested in MySQL/PostgreSQL/MsSQL.


Your question asks what happens when there are more than 4 or 8 rows (sizeof (unsigned int)). But I think you mean What happens when trying to insert a row when there will be 2^32 (or 2^64) rows?

I've never seen it, and I've worked with some really big databases. I expect the insert fails and causes the transaction to roll back. It can be sensed in MySQL with an insert probe.

0

精彩评论

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