查看各个数据库表大小(不包含索引),以及表数据量
mysql:
select table_name,concat(round((DATA_LENGTH/1024/1024),2),'M')as size,table_rows from information_schema.tables order by table_rows desc limit 20
 
postgresql:
select table_schema,TABLE_NAME,reltuples,pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"'))
from pg_class,information_schema.tables where relname=TABLE_NAME
ORDER BY reltuples desc limit 20
 
Sybase:
据空间大小的:
1.sybase(以16k逻辑页为例)
use YWST
go
select top 10 object_name(id) tabName,rowcnt rowCnt,convert(varchar,(pagecnt*16/1024)) + 'M' dataSize from systabstats order by rowcnt desc
 
oracle:
查记录条数可以用如下语句:
select *  from user_tables t where t.NUM_ROWS is not null order by t.NUM_ROWS desc 。
表实际使用的空间:
select num_rows * avg_row_len 
from user_tables

postgresql-查看各个数据库大小的更多相关文章

  1. SQL命令查看Mysql数据库大小

    SQL命令查看Mysql数据库大小的方法. 要想知道每个数据库的大小的话,步骤如下:1.进入information_schema 数据库(存放了其他的数据库的信息)use information_sc ...

  2. 查看MySQL数据库大小

    查看MySQL数据库大小 1.首先进入information_schema 数据库(存放了其他的数据库的信息) ? 1 2 mysql> use information_schema; Data ...

  3. 用SQL命令查看Mysql数据库大小

    要想知道每个数据库的大小的话,步骤如下: 1.进入information_schema 数据库(存放了其他的数据库的信息) use information_schema; 2.查询所有数据的大小: s ...

  4. PostgreSQL 查看单表大小

    1. 在数据库中查单个表 select pg_size_pretty(pg_relation_size('table_name')); 2. 查出并按大小排序 SELECT table_schema ...

  5. 使用SQL命令查看MYSQL数据库大小

    mysql> mysql> use information_schema ; /*切换到information_schema数据下*/ Database changed mysql> ...

  6. postgresql 查看单个表大小

    3中方法,不论什么一个都行 方法一 ,查一个表 select pg_size_pretty(pg_relation_size('table_name')); 方法二 ,查出全部表并按大小排序 SELE ...

  7. postgresql查看数据库占用的物理存储空间大小

    1.手动查看: 查看数据库postgres的oid postgres=# SELECT oid from pg_database where datname='postgres'; oid------ ...

  8. MySQL查看数据库大小、表大小和最后修改时间

    查看数据库表基本信息. select * from information_schema.TABLES where information_schema.TABLES.TABLE_SCHEMA = ' ...

  9. mysql查询数据库大小和表

    每个mysql都有一个库information_schema,里面有一张表TABLES存储了所有数据库表的信息,因此,可以从这张表中查看数据库大小和表大小 查询数据库大小 ,),'GB') as da ...

  10. 查看mysql数据库体积

    查看MySQL数据库大小 1.首先进入information_schema 数据库(存放了其他的数据库的信息) ? 1 2 mysql> use information_schema; Data ...

随机推荐

  1. openstack之flavor管理

    概览 [root@cc07 ~]# nova help | grep flavor flavor-access-add Add flavor access for the given tenant. ...

  2. RNN入门

    RNN入门学习 原文地址:http://blog.csdn.net/hjimce/article/details/49095371 作者:hjimce 一.相关理论 RNN(Recurrent Neu ...

  3. 小论文matlab作图技巧

    小论文matlab作图技巧 编辑->复制选项 编辑->图形属性 图中右击->字型 编辑->复制图片,即可. 效果: 宽:5.9高: 7.91

  4. WinSockets编程(六)select模式

    select模式的思想 创建FD_SET fd_all,并初始化FD_ZERO(&fd_all); Step1  初始时: Step2   加入一个套接字之后,比如FD_SET(sServer ...

  5. 7-18 Hashing - Hard Version

    7-18 Hashing - Hard Version (30 分) Given a hash table of size N, we can define a hash function . Sup ...

  6. (转)eclipse下配置tomcat7的几个重要问题,值得一看

    转自:http://jingyan.baidu.com/article/ab69b270ccc4792ca7189fd6.html 这段时间开始接触的servlet,今天尝试在eclipse下配置to ...

  7. 网络编程socket、udp

    PS:主机字节顺序,个位在低字节上 计算机本身不能通讯,使通过在同一主机或者不同主机内的软件进行数据传输. 套接字socket:套接字socket可以参照文件指针来理解,文件指针是表示对文件打开进行某 ...

  8. Codeforces Round #540 (Div. 3)--1118B - Tanya and Candies(easy TL!)

    Tanya has nn candies numbered from 11 to nn. The ii-th candy has the weight aiai. She plans to eat e ...

  9. mysql同时使用order by和limit查询时的一个严重隐患 -- 丢失数据

    转自: https://blog.csdn.net/tsxw24/article/details/44994835 我经常使用order by和limit来做数据分页显示并排序,一直也没发现过什么问题 ...

  10. MyBatis高级篇之整合ehcache缓存框架

    MyBatis高级篇之整合ehcache缓存框架  2017-09-01  0 Comments  1,671 Views  0 Times 一.前言 MyBatis为我们提供了Cache接口,也提供 ...