Thread: dbsize patch
View Single Post

   
  #6 (permalink)  
Old 04-18-2008, 12:01 AM
Andreas Pflug
 
Posts: n/a
Default Re: dbsize patch

Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.de> writes:
>
>>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'

>
>
> Your suggestion would be more compelling if the example were correct ;-).
> Consider more than one index on the same table.


Hopefully SUM() will do the job.

Regards,
Andreas

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply With Quote