postgresql 查看单个表大小】的更多相关文章

3中方法,不论什么一个都行 方法一 ,查一个表 select pg_size_pretty(pg_relation_size('table_name')); 方法二 ,查出全部表并按大小排序 SELECT table_schema || '.' || table_name AS table_full_name, pg_size_pretty(pg_total_relation_size('"' ||table_schema || '"."' || table_name ||…
1. 在数据库中查单个表 select pg_size_pretty(pg_relation_size('table_name')); 2. 查出并按大小排序 SELECT table_schema || '.' || table_name AS table_full_name, pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) AS s…
sql查看所有表大小的方法. 代码: declare @id int ) declare @pages int declare @dbname sysname ,) ,) ,) create table #spt_space ( [objid] int null, [rows] int null, ) null, ) null, ) null, ) null ) set nocount on -- Create a cursor to loop through the user tables d…
转载 http://blog.51yip.com/pgsql/1525.html 1,查看数据库 playboy=> \l //\加上字母l,相当于mysql的,mysql> show databases; List of databases Name | Owner | Encoding -----------+----------+---------- playboy | postgres | UTF8 postgres | postgres | UTF8 template0 | post…
/*单个表每个索引的大小*/ SELECT sum(stat_value) pages, table_name part, index_name, concat(,),'M',' rows') * @@innodb_page_size size FROM mysql.innodb_index_stats WHERE table_name = '你的表名' AND database_name = '你的数据库名' AND stat_description LIKE 'Number of pages…
关键词:查看表大小,mysqlshow mysqlshow --count -uroot -p test…
一.查看表名和对应的数据行数select  a.name as '表名',b.rows as '表数据行数'from sysobjects a inner join sysindexes bon a.id = b.idwhere   a.type = 'u'and b.indid in (0,1)--and a.name not like 't%'order by b.rows desc 二.查看表名和表占用空间信息--判断临时表是否存在,存在则删除重建if exists(select 1 fr…
create table #Data(name varchar(100),row varchar(100),reserved varchar(100),data varchar(100),index_size varchar(100),unused varchar(100)) declare @name varchar(100) declare cur cursor for select name from sysobjects where xtype='u' order by name ope…
//先进去MySQL自带管理库:information_schema //自己的数据库:dbwww58com_kuchecarlib //自己的表:t_carmodelparamvalue mysql> use information_schema; Database changed mysql> select data_length,index_length -> from tables where -> table_schema='dbwww58com_kuchecarlib'…
select round(sum(DATA_LENGTH / 1024 / 1024 ), 2) from `information_schema`.`tables` where table_schema = '%s' and table_name = '%s' % (db_name, table_name) 单位M…