Re: Add SKIP LOCKED to VACUUM and ANALYZE

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Lyes Ameddah <lyes(dot)amd(at)gmail(dot)com>
Subject: Re: Add SKIP LOCKED to VACUUM and ANALYZE
Date: 2018-09-03 23:19:46
Message-ID: 20180903231946.GD1343@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jul 29, 2018 at 10:56:24PM +0000, Bossart, Nathan wrote:
> Since vacuum_rel() already obtains an AccessExclusiveLock on the
> relation for VACUUM FULL, we might be able to skip altering
> cluster_rel(). I think we will need to alter it if we are going to
> add SKIP LOCKED to CLUSTER, though.

Nathan, could you rebase your patch set? From what I can see the last
patch set applies with one conflict, and it would be nice for clarity to
split the routines for analyze, vacuum and cluster into separate places.
Similar to what is done with vacuum_is_relation_owner, having the same
set of logs for vacuum and analyze may be cleaner. The set of ownership
checks should happen after the skip lock checks to be consistent between
the ownership checks done when building the relation list (list
expansion for partitions and such) as well as for vacuum_rel() and
analyze_rel().

With all the work which has been done already, I don't think that we are
that far from getting something committable.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-09-03 23:44:20 Re: Loaded footgun open_datasync on Windows
Previous Message Andres Freund 2018-09-03 23:13:40 Re: Caching query plan costs