Thanks!

One follow up question.  In the example given, it says there are 36
bytes for each row header and 4 bytes for each pointer to a tuple.  I'm
not sure where these numbers (36 and 4) are coming from.  Are they
standard for *every* table?  If my table has more than just two
integers, for example, will each row header be more than 36 bytes?

Thanks in advance.
Mitesh

-----Original Message-----
From: Mitch Vincent [mailto:mitch@venux.net]
Sent: Thursday, April 12, 2001 3:16 PM
To: Mitesh Shah; pgsql-hackers@postgresql.org
Subject: Re: Estimating Size of Database


In the FAQ..

http://www.postgresql.org/docs/faq-english.html#4.7

Good luck!

-Mitch
Software development : 
You can have it cheap, fast or working. Choose two.
----- Original Message ----- 
From: "Mitesh Shah" <Mitesh.Shah@bangnetworks.com>
To: <pgsql-hackers@postgresql.org>
Sent: Thursday, April 12, 2001 6:10 PM
Subject: Estimating Size of Database


> Is there a Web site or some info somewhere that tells you how to
> estimate the size of your database.
> 
> I know what my schema is and how many records will be in each table
(but
> non have been inserted yet).  How can I project how much disk space I
> will need for the database?
> 
> Thanks!
> Mitesh
> 
> ---------------------------(end of
broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 


Thu, 12 Apr 2001 15:26:06 -0700
"Mitesh Shah" <Mitesh.Shah@bangnetworks.com>
RE: Estimating Size of Database
Mitesh Shah writes:

> One follow up question.  In the example given, it says there are 36
> bytes for each row header and 4 bytes for each pointer to a tuple.  I'm
> not sure where these numbers (36 and 4) are coming from.  Are they
> standard for *every* table?  If my table has more than just two
> integers, for example, will each row header be more than 36 bytes?

More or less.  Quoth the source:

typedef struct HeapTupleHeaderData
{
        Oid                     t_oid;                  /* OID of this tuple -- 4 bytes */

        CommandId       t_cmin;                 /* insert CID stamp -- 4 bytes each */
        CommandId       t_cmax;                 /* delete CommandId stamp */

        TransactionId t_xmin;           /* insert XID stamp -- 4 bytes each */
        TransactionId t_xmax;           /* delete XID stamp */

        ItemPointerData t_ctid;         /* current TID of this or newer tuple */
        int16           t_natts;                /* number of attributes */

        uint16          t_infomask;             /* various infos */

        uint8           t_hoff;                 /* sizeof() tuple header */

        /* ^ - 31 bytes - ^ */

        bits8           t_bits[MinHeapTupleBitmapSize / 8];
        /* bit map of NULLs */

        /* MORE DATA FOLLOWS AT END OF STRUCT */
} HeapTupleHeaderData;

Most of the fields are for maintaining information required for
transaction rollback and multi-version concurrency control, in case you
can't quite decode it.  ;-)

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Fri, 13 Apr 2001 01:04:06 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: RE: Estimating Size of Database