使用Smallautofield作为Django的主要钥匙的好处?

发布于 2025-02-08 02:20:56 字数 181 浏览 1 评论 0原文

我的桌子将有大约2000行。

使用Smallautofield作为主要钥匙而不是标准自动场有任何性能好处吗?

另外,如果将来我在我的小型菲尔德(Smallautofield)中耗尽了32,000个增量整数,那么将其更改为常规自动赛将有多困难?

PS。我正在使用sqlite,但可以切换到Postgres。

My table will have around 2000 rows.

Are there any performance benefits to using SmallAutoField as the primary key rather than the standard AutoField?

Also, if in the future I run out of the 32,000 incrementing integers in my SmallAutoField, how difficult would it be to change it to a regular AutoField?

PS. I am using SQLite but may switch to Postgres.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文