Estimating Size of Database

Started by Mitesh Shahalmost 25 years ago4 messages
#1Mitesh Shah
Mitesh.Shah@bangnetworks.com

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

#2Mitch Vincent
mitch@venux.net
In reply to: Mitesh Shah (#1)
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

Show quoted text

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

#3Mitesh Shah
Mitesh.Shah@bangnetworks.com
In reply to: Mitch Vincent (#2)
RE: Estimating Size of Database

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)---------------------------

Show quoted text

TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Mitesh Shah (#3)
Re: 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/