PostgreSQL表及索引存储开销

总览

行数: 17,000,000
表大小: 2193M
索引: 4401M
------------------------------------
存储空间总计: 6594M

表结构

CREATE TABLE tb1
(
  id 	bigserial 	NOT NULL,
  b1 	bigint 		NOT NULL DEFAULT 0,
  b2 	bigint 		NOT NULL DEFAULT 0,
  b3 	bigint 		NOT NULL DEFAULT 0,
  n1 	integer 	NOT NULL DEFAULT 0,
  n2 	integer 	NOT NULL DEFAULT 0,
  s1 	smallint 	NOT NULL DEFAULT 0,
  s2 	smallint 	NOT NULL DEFAULT 0,
  s3 	smallint 	NOT NULL DEFAULT 0,
  s4 	smallint 	NOT NULL DEFAULT 0,
  c1 	character 	arying(250) NOT NULL DEFAULT ''::character varying,
  c2 	character 	arying(250) NOT NULL DEFAULT ''::character varying,
  ctime timestamp without time zone NOT NULL DEFAULT now(),
  mtime timestamp without time zone NOT NULL DEFAULT now(),
  CONSTRAINT id PRIMARY KEY (id) USING INDEX TABLESPACE test_index
)
WITH (OIDS=TRUE);
ALTER TABLE tb1 OWNER TO pgsql;

索引结构

索引字段: 	id,b1,b2,b3,n1,n2,s1,s2,s3,s4,ctime,mtime
索引类型: 	B-tree

典型记录行

ID: 1200

1200, 58978769, 7727542, 
906551, 69004, 
5747, 9788, 
53, 8, 8, 
"4741608", "58746832", 
"2007-10-24 21:42:19.90392", "2007-10-24 21:42:19.90392"

ID: 5610000

5610000, 6115957, 9779630, 
203488, 66135, 
7421, 997, 
65, 8, 7, 
"3468287", "5315941", 
"2007-10-24 22:55:39.200836", "2007-10-24 22:55:39.200836"
 
tech-notes/postgresql-tablespace-cost.txt · 最后更改: 2007/12/28 15:30 由 blf
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki