Re: FSM rewrite committed, loose ends - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: FSM rewrite committed, loose ends
Date
Msg-id 48E223CD.3020507@enterprisedb.com
Whole thread Raw
In response to Re: FSM rewrite committed, loose ends  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Responses Re: FSM rewrite committed, loose ends  (Dimitri Fontaine <dfontaine@hi-media.com>)
List pgsql-hackers
Gurjeet Singh wrote:
> On Tue, Sep 30, 2008 at 6:09 PM, Dimitri Fontaine <dfontaine@hi-media.com>wrote:
>> What's practical about pg_relation_size() and pg_total_relation_size() as
>> of
>> 8.3 is that the diff is the cumulated indexes storage volume. Your proposal
>> makes it harder to get this information, but sounds good otherwise.
>> Would it be possible to add in some new APIs to?
>>  a. pg_relation_size()
>>  b. pg_relation_fsm_size()
>>  c. pg_relation_indexes_size()
>>  d. pg_total_relation_size() = a + b + c
> 
> You forgot the toast size.

Yeah, pg_total_relation_size() - pg_relation_size() is not equal to the 
total size of indexes because of that.

But you can do SUM(pg_relation_size(index)) across all the indexes for that:

SELECT SUM(pg_relation_size(i.oid))   FROM pg_index x   JOIN pg_class c ON c.oid = x.indrelid   JOIN pg_class i ON
i.oid= x.indexrelid  WHERE i.relkind = 'i'::"char" AND c.relname='foo';
 

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: FSM rewrite committed, loose ends
Next
From: Heikki Linnakangas
Date:
Subject: Re: FSM rewrite committed, loose ends