Re: dbsize patch - Mailing list pgsql-patches

From Andreas Pflug
Subject Re: dbsize patch
Date
Msg-id 41F8F3D1.1040408@pse-consulting.de
Whole thread Raw
In response to Re: dbsize patch  (Neil Conway <neilc@samurai.com>)
Responses Re: dbsize patch
Re: dbsize patch
List pgsql-patches
Neil Conway wrote:
> On Tue, 2005-01-25 at 16:49 -0700, Ed L. wrote:
>
>>The attached dbsize patch:
>>
>>    + makes relation_size(relname) include toast tables;
>>    + adds aggregate_relation_size(relname) to count table data and indices;
>>    + adds indices_size(relname) to report the size of indices for a relation;

Hm, these are all implementable as SQL functions, do we need these hard
coded too?

e.g.
create function aggregate_relation_size(oid) returns int8 as $CODE$
select sum(pg_relation_size(indexrelid)) from pg_index where indrelid=$1;
$CODE$ language 'SQL'

Regards,
Andreas

pgsql-patches by date:

Previous
From: "Dave Page"
Date:
Subject: Re: pg_autovacuum Win32 Service startup delay
Next
From: Tom Lane
Date:
Subject: Re: dbsize patch