postgresql - 每个数据库限制的 Postgresql 关系
问题描述
在 Postgresql 文档附录 K ( https://www.postgresql.org/docs/12/limits.html ) 中有一个限制列表:
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| Item | Upper Limit | Comment |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| database size | unlimited | |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| number of databases | 4,294,950,911 | |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| relations per database | 1,431,650,303 | |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| relation size | 32 TB | with the default BLCKSZ of 8192 bytes |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| rows per table | limited by the number of tuples that can fit onto 4,294,967,295 pages | |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| columns per table | 1600 | further limited by tuple size fitting on a single page; see note below |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| field size | 1 GB | |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| identifier length | 63 bytes | can be increased by recompiling PostgreSQL |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| indexes per table | unlimited | constrained by maximum relations per database |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| columns per index | 32 | can be increased by recompiling PostgreSQL |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| partition keys | 32 | can be increased by recompiling PostgreSQL |
+------------------------+-----------------------------------------------------------------------+------------------------------------------------------------------------+
“每个数据库的关系”行是指数据库中每一行的关系总数,或声明的外键数?
例如,两个带有外键的表加入都算作数据库中的 1 个关系?还是 1 * 行数(1.000 行等于 1.000 个关系)?
非常感谢你的帮助 :)
解决方案
“关系”是存储在目录表中的任何内容pg_class
:表、视图、序列、索引、物化视图、分区表和分区索引。
该限制主要是理论上的,实际上,如果您有 100000 个左右的关系,您将遇到麻烦。
推荐阅读
- asp.net-core - Kubernetes 中的警告“将密钥存储在目录 '{path}' 中,可能不会保留在容器之外。”
- .htaccess - 如何配置 .htaccess 文件以允许注入样式和脚本?
- django - 每个用户的唯一字段值,自定义字段验证
- java - 单元测试Java中的InvalidUseOfMatchersException
- javascript - ChartJS 自定义图例甜甜圈将图例与图表区域分开
- python - 如何部署和上传 python 应用程序到 CPanel?
- nginx - NGINX 在相同的 url 上提供内容而无需重定向
- python-3.x - 如何使用 Python Boto3 在 AWS 中下载 .rdp 文件
- c# - ADODB.RecordSet 在迭代过程中可以改变迭代顺序吗
- amazon-web-services - AWS IoT 子物?