Re: fsm and vacuum

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com>
Cc: PgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: fsm and vacuum
Date: 2010-12-03 08:54:53
Message-ID: 4CF8B05D.2060505@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi,

Le 03/12/2010 00:19, Little, Douglas a écrit :
> [...]
> Thanks for the response.

No problem, but keep your anwser to the list, even if it's not the good
one :)

> Still a bit confused.
> Q: The guk settings max_fsm_relations/pages are used by the db engine to set the size of the freespace map.

In memory, yes.

> Q: vacuum scans thru the file and adds free slots to the map when a table is vacuumed

Yes.

> Q: the map is used by the engine when inserting a row (new or versioned).

Yes.

> So is the only way to initialize the fsm to run vacuum?

Yes.

> We're experiencing problems using vacuum full. GP recommends ctas/truncate/reload as alternative.
> Obviously won't work for system tables.
> My thought is vacuum full isn't working because the fsm was undersized.

vacuum full first scans the whole table to find free space, and then
scans backward to move every still-in-use space at the beginning of the
table. I don't know if vacuum full puts its information in the fsm, but
I believe so. So, if the fsm is undersized, you risk to have a not fully
effective vacuum full.

Anyway, you should probably not use vacuum full, unless you have a
*really* good reason.

Remember to REINDEX after your VACUUM FULL. Meaning you should probably
use CLUSTER, which will be fully effective and quicker. But you need an
index.

> Anything in the developers docs that would help me understand how it works?

This could be of interest:

http://wiki.postgresql.org/wiki/VACUUM_FULL

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Little, Douglas 2010-12-03 13:40:32 Re: fsm and vacuum
Previous Message Guillaume Lelarge 2010-12-02 21:54:18 Re: fsm and vacuum