Re: Concurrent VACUUM and ANALYZE

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Concurrent VACUUM and ANALYZE
Date: 2008-07-21 22:15:53
Message-ID: 20080721221553.GK5842@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jonah H. Harris escribió:
> Currently, one cannot perform a concurrent VACUUM and ANALYZE. This
> is a significant problem for tables which are not only large and have
> designated cost-delays, but which are also heavily inserted into and
> deleted from. After performing a quick cursory investigation on this,
> it doesn't appear to be difficult to change. Other than the
> ShareUpdateExclusiveLock, is there anything technically preventing us
> from performing both concurrently?

This means that VACUUM ANALYZE must grab both locks ... is there a
gotcha here?

The main problem I see with this idea is that the dead and total tuple
count computed by ANALYZE would be immediately out of date, and if it
happens to finish after VACUUM then it'll overwrite the values the
latter just wrote, which are more correct. Not sure how serious a
problem this is.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-07-21 23:19:46 Re: pg_dump additional options for performance
Previous Message Andrew Sullivan 2008-07-21 22:13:59 Re: Load spikes on 8.1.11