Re: Postgres vs. DSpam - Mailing list pgsql-performance

From Neil Conway
Subject Re: Postgres vs. DSpam
Date
Msg-id 1101439525.12697.11.camel@localhost.localdomain
Whole thread Raw
In response to Re: Postgres vs. DSpam  (Andrew McMillan <andrew@catalyst.net.nz>)
List pgsql-performance
On Fri, 2004-11-26 at 14:37 +1300, Andrew McMillan wrote:
> In PostgreSQL the UPDATE will result
> internally in a new record being written, with the old record being
> marked as deleted.  That old record won't be re-used until after a
> VACUUM has run, and this means that the on-disk tables will have a lot
> of dead rows in them quite quickly.

Not necessarily: yes, you need a VACUUM to begin reusing the space
consumed by expired tuples, but that does not mean "tables will have a
lot of dead rows in them quite quickly". VACUUM does not block
concurrent database activity, so you can run it as frequently as you'd
like (and as your database workload requires). There is a tradeoff
between the space consumed by expired tuple versions and the I/O
required to do a VACUUM -- it's up to the PG admin to decide what the
right balance for their database is (pg_autovacuum et al. can help make
this decision).

> The reason that PostgreSQL operates this way, is a direct result of the
> way transactional support is implemented, and it may well change in a
> version or two.

I doubt it.

-Neil



pgsql-performance by date:

Previous
From: Andrew McMillan
Date:
Subject: Re: Postgres vs. DSpam
Next
From: Jerome Macaranas
Date:
Subject: Re: [GENERAL] HELP speed up my Postgres