Re: FSM rewrite committed, loose ends

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Cc: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: FSM rewrite committed, loose ends
Date: 2008-09-30 13:04:13
Message-ID: 48E223CD.3020507@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gurjeet Singh wrote:
> On Tue, Sep 30, 2008 at 6:09 PM, Dimitri Fontaine <dfontaine(at)hi-media(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-09-30 13:13:00 Re: FSM rewrite committed, loose ends
Previous Message Dimitri Fontaine 2008-09-30 12:59:08 Re: FSM rewrite committed, loose ends