Re: Improve behavior of concurrent ANALYZE/VACUUM

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: bossartn(at)amazon(dot)com, horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp
Subject: Re: Improve behavior of concurrent ANALYZE/VACUUM
Date: 2018-08-17 06:42:23
Message-ID: 20180817064223.GH1693@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 13, 2018 at 12:21:42AM +0200, Michael Paquier wrote:
> The patch attached includes tests which I have used to also check that
> correct error messages are produced for VACUUM, VACUUM ANALYZE and
> ANALYZE.

I have reworked the patch on this side, clarifying the use of the new
common API for the logs. One thing I am wondering about is what do we
want to do when VACUUM ANALYZE is used. As of HEAD, if vacuum_rel()
stops, then analyze_rel() is never called, and the only log showing up
to a non-owner user would be:
skipping "foo" --- only superuser can vacuum it

With this patch, things become perhaps more confusing by generating two
WARNING log entries:
skipping "foo" --- only superuser can vacuum it
skipping "foo" --- only superuser can analyze it

We could either combine both in a single message, or just generate the
message for vacuum as HEAD does now. I have also added some simple
regression tests triggering the skipping logs for shared catalogs,
non-shared catalogs and non-owners. This could be a separate patch as
well.

Input is welcome.
--
Michael

Attachment Content-Type Size
0001-Improve-VACUUM-and-ANALYZE-by-avoiding-early-lock-qu.patch text/x-diff 24.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-08-17 06:49:24 Re: FailedAssertion on partprune
Previous Message Ashutosh Bapat 2018-08-17 06:40:20 Re: TupleTableSlot abstraction