Re: Followup: vacuum'ing toast

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Dave Crooke <dcrooke(at)gmail(dot)com>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Followup: vacuum'ing toast
Date: 2009-11-05 01:27:17
Message-ID: 4AF229F5.201@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dave Crooke wrote:
> Since the Jackrabbit tables are in the same namespace / user / schema
> as ours, am I right in thinking that this is effectively blocking the
> entire auto-vaccum system from doing anything at all?
>
Yes, but the problem is actually broader than that: it wouldn't matter
if it was a different user or namespace, the impact would still be the
same. PostgreSQL gets rid of needing to hold a bunch of table/row locks
by using an approach called MVCC:
http://www.postgresql.org/docs/8.4/static/mvcc-intro.html

The biggest downside of that approach is that if you have an old client
lingering around, things that happened in the database after it started
can't be cleaned up. That client might still be referring to the old
copy of that data, so that anything it looks at will be a consistent
snapshot that includes the earlier version of the rows, the database is
paranoid about letting VACUUM clean the things you've deleted up.

In 8.4 this situation is improved for some common use cases. In the 8.3
you're using, an old transaction will block any VACUUM attempt from
moving past that point in time forever. You have to figure out how to
get Hibernate to close the transaction it's leaving open for VACUUM to work.

--
Greg Smith greg(at)2ndquadrant(dot)com Baltimore, MD

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Craig Ringer 2009-11-05 03:01:26 Re: Followup: vacuum'ing toast
Previous Message Craig Ringer 2009-11-05 01:12:17 Re: High Frequency Inserts to Postgres Database vs Writing to a File