Re: FSM rewrite committed, loose ends

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

Dimitri Fontaine wrote:
> Le mardi 30 septembre 2008, Heikki Linnakangas a écrit :
>> Dimitri Fontaine wrote:
>>> Question for the slow readers: this new FSM scheme being dynamic, it's no
>>> longer possible to have table bloat, right?
>>> (where table bloat is full of dead-for-any-transaction tuples, and you
>>> have to CLUSTER or VACUUM FULL to be able to reuse the space it takes)
>> No, it didn't change that. Regular VACUUMing or autovacuum is still needed.
>
> But IIUC correctly it's no longer possible for PostgreSQL to forget about
> where bloat is, so regular vacuuming will know how clean out any bloat any
> time?

That has never been a problem. VACUUM has always found and removed all
dead tuples.

> For example, a purge script which does a large DELETE could overrun the
> max_fsm_pages setting, resulting in permanent bloat (until table rewrite).
> This large DELETE will now be tracked completely by the new FSM, so
> autovacuum will be able to have the space reused later?

It isn't really permanent. If you increase max_fsm_pages, restart and
vacuum again, vacuum will pick up all the empty pages.

But yes, the new FSM is always large enough to hold information about
all pages in the relation, so you can no longer get table bloat because
of a too small max_fsm_pages or max_fsm_relations setting.

You can still get table bloat because of other reasons, like not
vacuuming often enough.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-30 13:15:47 Re: [BUG] pg_ctl restart at the vanilla v8.3.4
Previous Message Heikki Linnakangas 2008-09-30 13:04:13 Re: FSM rewrite committed, loose ends