这个查询使用了pg_tables系统视图,它包含了数据库中所有普通表的信息。pg_total_relation_size函数返回指定表的总大小(包括表本身、索引和TOAST表)。查询结果会按照表的大小降序排列,方便你查看最大的表。 分析查询结果: 执行上述查询后,你将得到一个结果集,其中包含了数据库中所有表的名称、它们所在的schema以及它们...
get_ao_compression_ratio(表名) 查看AO表的压缩率 pg_total_relation_size(表名) 查看AO表的占用空间大小(通常和函数pg_size_pretty()连用) 查看AO表test1的分布情况 select get_ao_distribution(test1); 查看AO表test1的压缩率 select get_ao_compression_ratio(test1); 查看AO表test1的占用空间大小 select pg...
查询库占用磁盘大小 select pg_size_pretty(pg_database_size('MyDatabase')); 查询表占用磁盘大小 普通表 select pg_size_pretty(pg_relation_size('relation_name')) ; 查看所有表占用的表空间 SELECT table_schema || '.' || table_name AS table_full_name, pg_size_pretty(pg_total_relation_size(...
greenplum统计表占用空间 1.查找某shema下所有表占用的空间 selectschemaname,tablename,round(sum(pg_total_relation_size(schemaname||','||tablename))/1024/1024/1024,2)astablesize_Gfrompg_tableswhereschemanamein('edc_wg')groupby1,2order by tablesize_G desc; 2.查询单表占用空间 pg_size_pretty(p...
5.3 系统自带表空间1表空间pg_default是用来存储系统目录对象、用户表、用户表index、和 Vc出现不能连接到一个或多个 vCenter server 系统:http://vcenter-vx.utibet.edu.cn:443/sdk "relation",pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"FROM...问题描述: 解决办法: esxi6.7的bug...
selectpg_size_pretty(pg_total_relation_size('daas.ff.newtable_1_prt_default_p')); pg_size_pretty --- 256kB -- 查看指定数据库 select pg_size_pretty(pg_database_size('daas')); pg_size_pretty --- 62 MB -- 所有数据库 selectdatname,pg...
sum(SIZE) total_size FROM (SELECT gp_segment_id, oid::regclass tabname, pg_relation_size(oid) SIZE FROM gp_dist_random('pg_class') WHERE relkind='r' AND relstorage IN ('a','h')) t GROUP BY tabname ORDER BY 2 DESC; 3. 分区表 ...
zwcdb=# select pg_size_pretty(pg_total_relation_size('gp_test')); pg_size_pretty --- 2186 MB 查看指定数据库 zwcdb=# select pg_size_pretty(pg_database_size('zwcdb')); pg_size_pretty --- 2241 MB 所有数据库 zwcdb=# select datname,pg_size_pretty(pg_database_size(datname)) ...
30.查看数据库表大小 select pg_size_pretty(pg_total_relation_size('test_db.t_l_collectfile')) as fulltblsize,pg_size_pretty(pg_relation_size('test_db.t_l_collectfile')) as justthetblsize; 31.设置执行超过指定秒数的sql语句输出到日志 log_min_duration_statement = 3 ...
pg_size_pretty(pg_table_size(C.oid)) AS size, pg_size_pretty(pg_indexes_size(C.oid)) AS idxsize, pg_size_pretty(pg_total_relation_size(C.oid)) as "total" FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) ...