Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster