PostgreSQL查看表大小的命令】的更多相关文章

SELECT table_name, pg_size_pretty(table_size) AS table_size, pg_size_pretty(indexes_size) AS indexes_size, pg_size_pretty(total_size) AS total_size FROM ( SELECT table_name, pg_table_size(table_name) AS table_size, pg_indexes_size(table_name) AS inde…
mysql查看表大小 一:命令 show table status like 'table_name'\G; mysql> show table status like 'x'\G; . row *************************** Name: x Engine: InnoDB Version: Row_format: Compact Rows: Avg_row_length: Data_length: Max_data_length: Index_length: Data_f…
在linux中,常用查看空间大小的命令有df.du,下面依次介绍一下. df 命令是linux系统上以磁盘分区为单位来查看文件系统的命令,后面可以加上不同的参数来查看磁盘的剩余空间信息.Linux du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是查看当前指定文件或目录(会递归显示子目录)占用磁盘空间大小,还是和df命令有一些区别的. 1.使用df,不带任何参数的效果如下: 第一列:文件系统 第二列:容量 第三列:已用容量 第四列:可用容量 第五列:已用容量% 第六列:挂载…
一.简单描述表结构,字段类型 desc tabl_name; 显示表结构,字段类型,主键,是否为空等属性,但不显示外键. 例如:desc table_name 二.查询表中列的注释信息 select * from information_schema.columnswhere table_schema = 'db' #表所在数据库and table_name = 'tablename' ; #你要查的表 例如: 可以自动选择你需要信息 三.只查询列名和注释select column_name,…
一.简单描述表结构,字段类型 desc tabl_name; 显示表结构,字段类型,主键,是否为空等属性,但不显示外键. 二.查询表中列的注释信息 select * from information_schema.columns where table_schema = 'db'  #表所在数据库 and table_name = 'tablename' ; #你要查的表 三.只查询列名和注释 select  column_name, column_comment from informatio…
一.简单描述表结构,字段类型desc tabl_name;显示表结构,字段类型,主键,是否为空等属性,但不显示外键.二.查询表中列的注释信息select * from information_schema.columns where table_schema = 'db' #表所在数据库and table_name = 'tablename' ; #你要查的表三.只查询列名和注释select column_name, column_comment from information_schema.…
1.返回所有数据库信息(数据库名,创建日期,存储路径等).   use master; GO select * from dbo.sysdatabases 2.返回当前数据库所有对象(可根据type字段过滤出用户表,索引等). USE AdventureWorks2008R2; GO SELECT * FROM SYS.objects WHERE TYPE='U' 3.查询指定库中所有表信息(记录数,使用空间等). USE AdventureWorks2008R2; GO exec sp_MSF…
查看SqlServer 数据库中各个表多少行 : SELECT A.NAME ,B.ROWS FROM sysobjects A JOIN sysindexes B ON A.id = B.id WHERE A.xtype = 'U' AND B.indid IN(0,1) ORDER BY B.ROWS DESC 数据库磁盘占用量: select name, CAST(convert(float,size) * (8192.0/1024.0)/1024 AS nvarchar)+'MB' AS…
-- 表索引select * from pg_indexes where tablename='person_wechat_label';select * from pg_statio_all_indexes where relname='person_wechat_label';-- 所有表SELECT * FROM pg_tables;-- 所有视图SELECT * FROM pg_views;-- 表结构SELECT a.attnum,a.attname AS field,t.typnam…
创建数据库create database abc; 显示数据库 show databases; 使用数据库 use 数据库名; 直接打开数据库 mysql -h localhost -u root -p123456 -d 数据库名 显示表 show tables; desc 表名;show columns from 表名;describe 表名;show create table 表名;use information_schemaselect * from columns where table…