X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id E021430FB33; Wed, 25 Jun 2003 04:34:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 37467-04; Wed, 25 Jun 2003 01:34:47 -0300 (ADT) Received: from TactiCom-MA1.TactiCom.com (unknown [216.235.244.20]) by svr1.postgresql.org (Postfix) with SMTP id A0D8A30F200; Wed, 25 Jun 2003 01:34:46 -0300 (ADT) Received: from [203.124.133.194] by TactiCom-MA1.Nulinkinc.com (NTMail 4.30.0013/NU4135.00.d4f82e0c) with ESMTP id zighiaaa for ; Wed, 25 Jun 2003 00:34:27 -0400 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C33AD3.10BF8530" Subject: database & table size X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Wed, 25 Jun 2003 10:04:29 +0530 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: database & table size Thread-Index: AcM60rsjtFJWHaa9EdedogBABabtaA== From: "Anagha Joshi" To: , X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_60_70, HTML_MESSAGE, RCVD_IN_UNCONFIRMED_DSBL X-Spam-Level: * X-Archive-Number: 200306/291 X-Sequence-Number: 9282 This is a multi-part message in MIME format. ------_=_NextPart_001_01C33AD3.10BF8530 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello , Here is something I've found related to database & table size My databse name is 'test' and table name is 'cdrrec'. 1. Following will give oids & database test=3D# select datname, oid from pg_database; datname | oid -------------+--------- fcsconfigdb | 16562 template1 | 1 template0 | 16555 fcsauditdb | 16565 fcsbsdb | 16566 fcsmibdb | 32386 fcstrapdb | 52561 test | 1580177 (8 rows)=20 test=3D# select oid from pg_class where relname =3D 'cdrrec'; oid --------- 2078989 (1 row) 2. Here are actual disk sizes of tables & database $ cd /export/home/uxapps/postgresql-7.2.4/data/base/ $ ls -l total 32 drwx------ 2 postgres postgres 1536 Jun 6 17:13 1 drwx------ 2 postgres postgres 1536 Jun 24 15:02 1580177 drwx------ 2 postgres postgres 1536 Jun 6 17:02 16555 drwx------ 2 postgres postgres 2048 Jun 6 18:04 16562 drwx------ 2 postgres postgres 1536 Jun 10 16:18 16565 drwx------ 2 postgres postgres 2048 Jun 6 18:03 16566 drwx------ 2 postgres postgres 1536 Jun 6 17:41 32386 drwx------ 3 postgres postgres 1536 Jun 19 11:08 52561 3. the directory '1580177' corresponds to 'test' database. $ cd 1580177 4. the file '2078989' corresponds to 'cdrrec' file (table) $ ls -l 2078989 -rw------- 1 postgres postgres 2359296 Jun 24 17:18 2078989 This means table 'cdrrec' takes approx. 2030.2626953125 KB i.e. approx. 2MB Table is like this: test=3D# \d cdrrec; Table "cdrrec" Column | Type | Modifiers ---------+-----------------------+-------------------------------------- ---------------- seqno | integer | not null default nextval('"cdrrec_seqno_seq"'::text) //4 bytes timerec | bigint | //8 bytes=09=09=09=09=09=09 ack | boolean | default 'f'::bool //1 byte pos | boolean | default 'f'::bool //1 byte=09 ipaddr | character varying(16) | // 4 + 16 cdrs | bit varying(524288) | //64K Primary key: cdrrec_pkey *Sizes are as per documentation. Therefore, 1 record is of 65570 bytes i.e. 64.033203125 KB. And table contains 1000 records. But results are noway closer to '2MB". Any idea? Thanks, Anagha ------_=_NextPart_001_01C33AD3.10BF8530 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable database & table size

Hello ,<= /FONT>

Here is = something I’ve found related to database & table size

My datab= se name is ’test’= and table name is ‘cdrrec’.

    1. =      Following will give oids & database

test=3D#= select datname, oid from pg_database;

 &n= bsp; datname   |   oid

--------= -----+---------

 fc= sconfigdb |   16562

 te= mplate1   |       1

 te= mplate0   |   16555

 fc= sauditdb  |   16565

 fc= sbsdb     |   16566

 fc= smibdb    |   32386

 fc= strapdb   |   52561

 te= st        | 1580177

(8 rows)=

test=3D#= select oid from pg_class where relname =3D 'cdrrec';

 &n= bsp; oid

--------= -

 20= 78989

(1 row)<= /FONT>

    2. =      Here are actual disk sizes of tables & databas= e

$ cd /ex= port/home/uxapps/postgresql-7.2.4/data/base/

$ ls -l<= /FONT>

total 32=

drwx----= --   2 postgres postgres    1536 Jun  6 17:13= 1

drwx----= --   2 postgres postgres    1536 Jun 24 15:02 1580= 177

drwx----= --   2 postgres postgres    1536 Jun  6 17:02= 16555

drwx----= --   2 postgres postgres    2048 Jun  6 18:04= 16562

drwx----= --   2 postgres postgres    1536 Jun 10 16:18 1656= 5

drwx----= --   2 postgres postgres    2048 Jun  6 18:03= 16566

drwx----= --   2 postgres postgres    1536 Jun  6 17:41= 32386

drwx----= --   3 postgres postgres    1536 Jun 19 11:08 5256= 1


    3. =      the directory ‘1= 580177’ corresponds to ‘test’ database.

$ cd 158= 0177

    4. =      the file ‘2078989’ corresponds to ‘cdrrec’ file (ta= ble)

$ ls -l = 2078989

-rw-----= --   1 postgres postgres 2359296 Jun 24 17:18 2078989

This mea= ns table ’cdrrec’= takes approx. 2030.2626953125 KB i.e. approx. 2MB

Table is= like this:

test=3D#= \d cdrrec;

 &n= bsp;            = ;            &n= bsp;          Table "cdrr= ec"

 Co= lumn  |         Type &nbs= p;        |     = ;            &n= bsp;    Modifiers

--------= -+-----------------------+-------------------------------------------------= -----

 se= qno   | integer        &n= bsp;      | not null default nextval('"cdrrec= _seqno_seq"'::text)        <= /SPAN> //4 bytes

 ti= merec | bigint          &= nbsp;     |        &= nbsp;             &n= bsp;            &nbs= p;              = ;    //8 bytes=     &n= bsp;             &nb= sp;             &nbs= p;             =

 ac= k     | boolean      &nbs= p;        | default 'f'::bool  = ;              =               &= nbsp;     //1 byte

 po= s     | boolean      &nbs= p;        | default 'f'::bool  = ;              =               &= nbsp;     //1 byte   = ;    

 ip= addr  | character varying(16) |       &n= bsp;            &nbs= p;              = ;              =      // 4 + 16

 cd= rs    | bit varying(524288)   |   &= nbsp;             &n= bsp;             &nb= sp;             = ;         //= 64K

Primary = key: cdrrec_pkey

*Sizes a= re as per documentation.

Therefor= e, 1 record is of 65570 bytes i.e. 64.033203125 KB.

And tabl= e contains 1000 records.

But resu= lts are noway closer to ‘2MB”.

Any idea= ?

Thanks,<= /FONT>

Anagha


------_=_NextPart_001_01C33AD3.10BF8530--