Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql 11 如何';pg#U表空间#U大小';作品_Postgresql 11 - Fatal编程技术网

Postgresql 11 如何';pg#U表空间#U大小';作品

Postgresql 11 如何';pg#U表空间#U大小';作品,postgresql-11,Postgresql 11,我运行了以下命令并获得了以下信息,但对表大小操作有点困惑,因为我不知道pg_tablespace_size是如何工作的: my_db=> select pg_size_pretty(pg_total_relation_size('my_table')); pg_size_pretty ---------------- 123 GB (1 row) my_db=> select pg_size_pretty(pg_indexes_size('my_table')); pg_s

我运行了以下命令并获得了以下信息,但对表大小操作有点困惑,因为我不知道pg_tablespace_size是如何工作的:

my_db=> select pg_size_pretty(pg_total_relation_size('my_table'));
 pg_size_pretty 
----------------
 123 GB
(1 row)

my_db=> select pg_size_pretty(pg_indexes_size('my_table'));
 pg_size_pretty 
----------------
 34 GB
(1 row)

my_db=> select pg_size_pretty(pg_relation_size('my_table'));
 pg_size_pretty 
----------------
 27 GB
(1 row)
rest\u space=pg\u total\u relationship\u size('my\u table')-(pg\u index\u size('my\u table')+pg\u relationship\u size('my\u table'))

但我不知道rest_space(62 GB)在哪里,如果有人能解释一下,我将不胜感激。

pg_relation_size()
实际上是
pg_relation_size(,'main')
(请参阅)。另外还有自由空间映射(fsm)、可见性映射(vm)和init分叉,它们将影响整个大小


我想如果你做了
pg\u total\u relationship\u size()=pg\u table\u size()+pg\u index\u size(),你会得到正确的结果,因为你的问题似乎没有提到表空间