Re: Concurrent VACUUM and ANALYZE - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Concurrent VACUUM and ANALYZE
Date
Msg-id 20080721221553.GK5842@alvh.no-ip.org
Whole thread Raw
In response to Concurrent VACUUM and ANALYZE  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Responses Re: Concurrent VACUUM and ANALYZE  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List 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


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Load spikes on 8.1.11
Next
From: Tom Lane
Date:
Subject: Re: Load spikes on 8.1.11