pg_partition_indexes_size(oid|text, oidtext) bigint 指定名称的分区的索引使用的磁盘空间。其中,第一个参数为表名|oid,第二个参数为分区名|oid。 常见例子 查询所有数据库大小 select pg_database.datname, pg_size_pretty(pg_database_size(datname)) as size from pg_database; 查询所有表大小 se...
1. 数据库大小(pg_database_size) postgres=# select datname from pg_database; datname --- postgres osdbadb template1 template0 mytestdb01 db03 (6 rows) postgres=# select pg_database_size ('db03'),pg_size_pretty(pg_database_size('db03')); pg_database_size | pg_size_pretty ---...
playboy=>selectpg_size_pretty(pg_database_size('playboy'));pg_size_pretty---3553kB(1row) 查看所有数据库的大小 playboy=>selectpg_database.datname,pg_database_size(pg_database.datname)ASsizefrompg_database;dataname|size---+---postgres|3621512playboy|3637896template1|3563524template0|3563524...
select pg_database.datname, pg_database_size(pg_database.datname) AS size from pg_database; //查询所有数据库,及其所占空间大小 --2. 查询存在锁的数据表 select a.locktype,a.database,a.pid,a.mode,a.relation,b.relname -- ,sa.* from pg_locks a join pg_class b on a.relation = b...
当data目录下存在core文件,说明数据库进程存在过崩溃,可通过core文件进行分析。 pg清理大数据量表 查看所有数据库的大小 select pg_database.datname, pg_database_size(pg_database.datname) AS size from pg_database; 1 查看表的总大小,包括索引大小 ...
pg_database_size---3637896(1row)--查看所有数据库的大小playboy=>selectpg_database.datname, pg_database_size(pg_database.datname)ASsizefrompg_database; datname|size---+---postgres|3621512playboy|3637896template1|3563524template0|3563524(4rows)--以KB,MB,GB的方式来查看数据库大小playboy=>select...
pg_database_size --- 3637896 (1 row) playboy=> select pg_database.datname, pg_database_size(pg_database.datname) AS size from pg_database; //查看所有数据库的大小 datname | size ---+--- postgres | 3621512 playboy | 3637896 template...
由于篇幅限制,本章内容仅包含数据文件部分,其他方面请查看后续文章[1]。# 解决方案### 显示数据库的大小```Plain Textpostgres=# selectpg_database.datname,pg_size_pretty (pg_database_size(oid)) AS size frompg_database; datname | size ---+--- postgr... 如何排查 PostgreSQL 存储...
selectpg_database_size('osdba'),pg_size_pretty(pg_database_size('osdba')); 1. 查看表的大小 selectpg_size_pretty(pg_relation_size('ipdb2')); selectpg_size_pretty(pg_total_relation_size('ipdb2')); 1. 2. 上例中,pg_relation_size()仅计算表的大小,不包括索引的大小,而pg_total_relatio...
SELECT pg_size_pretty(pg_database_size('XX')) As dbsize; 查看所有数据库的大小 select pg_database.datname, pg_size_pretty (pg_database_size(pg_database.datname)) AS total_size from pg_database; 20)查看各数据库数据创建时间 代码语言:javascript 复制 select datname,(pg_stat_file(format(...