Re: measuring disk usage of records

From: "P(dot)J(dot) \"Josh\" Rovero" <rovero(at)sonalysts(dot)com>
To: Matthew Nuzum <cobalt(at)bearfruit(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: measuring disk usage of records
Date: 2003-12-31 21:20:09
Message-ID: 3FF33D89.9060404@sonalysts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Use contrib/dbsize, then you'll be able to

select relation_size('<table_name>');
select database_size('<database_name>');

Answers come back in bytes....

If the customer records are mixed with different customer
data in the same tables, it's a bit more complicated.

Matthew Nuzum wrote:

> Therefore, we'd like to avoid falling into the same trap and get a good
> understanding of how much storage space our customer's data is actually
> using.
>
> Here's the problem... A customer's data may be scattered across multiple
> tables. Some customers have X,000 records in table A, some have Y,000
> records in table B and etc. There's no way it can be as simple as saying
> "database takes X GB for Y customers so usage is X/Y"
>
> Does anyone have any suggestions that can help me to get access to this
> information?

--
P. J. "Josh" Rovero Sonalysts, Inc.
Email: rovero(at)sonalysts(dot)com www.sonalysts.com 215 Parkway North
Work: (860)326-3671 or 442-4355 Waterford CT 06385
***********************************************************************

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Nuzum 2003-12-31 21:32:51 Re: measuring disk usage of records
Previous Message Matthew Nuzum 2003-12-31 20:58:57 measuring disk usage of records