当数据库中的表的行数超过索引数据类型的最大大小时会发生什么?

发布于 2024-08-21 05:00:15 字数 105 浏览 1 评论 0原文

例如,如果我的表中有一个 unsigned int 索引,当我获得的行数多于 sizeof(unsigned int) 时会发生什么? 我对 MySQL/PostgreSQL/MsSQL 感兴趣。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撑一把青伞 2024-08-28 05:00:15

您的问题询问当超过 4 或 8 行 (sizeof (unsigned int)) 时会发生什么。但我认为你的意思是当有 2^32(或 2^64)行时尝试插入一行时会发生什么?

我从未见过它,而且我确实与一些人一起工作过大数据库。我预计插入会失败并导致事务回滚。它可以在 MySQL 中使用 插入探针来感知

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文