From: Alvaro Herrera <alvherre@commandprompt.com>
To: Chris Hoover <revoohc@gmail.com>
Cc: pgsql-admin@postgresql.org Admin <pgsql-admin@postgresql.org>
Subject: Re: More Autovacuum questions
Date: Tue, 15 Jul 2008 09:52:16 -0400
Message-ID: <20080715135216.GB7334@alvh.no-ip.org> (raw)
In-Reply-To: <1d219a6f0807150619o567709ebu7d28429d2907bf82@mail.gmail.com>
References: <1d219a6f0807150619o567709ebu7d28429d2907bf82@mail.gmail.com>
Chris Hoover escribió:
> Another question.
>
> When autovacuum sleeps, does it release the lock it has on the table?
What do you mean sleep? There are two sleeps: the one caused by
cost-based vacuum delay (lasts for some milliseconds, happens every
handful of pages vacuumed; no locks released here) and the big sleep
that happens after one worker finishes and the next one starts (all
locks are released).
When one autovac worker is processing a table, no other worker touches
it. So if you have a table that's 64 GB, it won't be analyzed until
the currently running vacuum finishes.
> What we would like to have happen is for vacuum to work for a while, sleep,
> and while it is sleeping run an analyze on the table. We need this due to
> how quickly our data is changing. Currently we are running analyze every 5
> minutes against the table of question and get a very serious performance hit
> when vacuum runs due to the index stats getting out of date. As soon as we
> rerun analyze after the vacuum happiness returns.
This is worst case for Postgres vacuuming, I think.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: alvherre@commandprompt.com, revoohc@gmail.com
Subject: Re: More Autovacuum questions
In-Reply-To: <20080715135216.GB7334@alvh.no-ip.org>
References: <1d219a6f0807150619o567709ebu7d28429d2907bf82@mail.gmail.com> <20080715135216.GB7334@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox