Re: Automatic free space map filling - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Automatic free space map filling
Date
Msg-id 20060301175159.GA7490@surnet.cl
Whole thread Raw
In response to Re: Automatic free space map filling  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Automatic free space map filling
List pgsql-hackers
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Tom Lane wrote:
> >> How does an optimistic FSM entry avoid the need to run vacuum?
> 
> > It ensures that all freed tuples are already in the FSM.
> 
> That has nothing to do with it, because the space isn't actually free
> for re-use until vacuum deletes the tuple.

I think the idea is a different "free space map" of sorts, whereby a
transaction that obsoletes a tuple puts its block number in that map.  A
transaction that inserts a new tuple goes to the FSM.  If nothing is
found, it then goes to the new map.  A block returned from that map is
then scanned and any tuple that's no longer visible for anyone is
reused.

The problem with this idea is scanning the block and for each tuple
determine if it's alive.  Essentially, we would be folding the "find
dead tuples and compress page" logic, which is currently in vacuum, back
to insert.  IMHO this is unacceptable from a performance PoV.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 8.2 Feature Freeze Rough Estimate
Next
From: Bruce Momjian
Date:
Subject: Re: [SQL] Interval subtracting