pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joshua D. Drake <jd@commandprompt.com>
Cc: andy <andy@squeakycode.net>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [ADMIN] Vacuum error on database postgres
Date: Thu, 14 Sep 2006 16:35:29 -0400
Message-ID: <3024.1158266129@sss.pgh.pa.us> (raw)
In-Reply-To: <45097CF4.7040409@commandprompt.com>
References: <44F82150.5000809@pnlassociates.com>
	<4001.1157121669@sss.pgh.pa.us>
	<ee7pua$2bou$1@news.hub.org>
	<27602.1158238299@sss.pgh.pa.us>
	<45095CDD.8090704@squeakycode.net>
	<29469.1158247230@sss.pgh.pa.us>
	<45097CF4.7040409@commandprompt.com>

"Joshua D. Drake" <jd@commandprompt.com> writes:
>> One possible fix today would be to make ANALYZE take
>> ShareUpdateExclusive lock instead, thus ensuring there is only one
>> ANALYZE at a time on a table.

> Why not an internal lock that people don't see?

We could add another LockTagType just for ANALYZE, but that seems like
rather a lot of infrastructure to support an extremely narrow corner
case, namely two people doing database-wide ANALYZE at the same time
inside transaction blocks.  (If they do it outside a transaction block
then the ANALYZE is divided into multiple xacts and so doesn't try to
hold locks on multiple tables concurrently.  autovacuum won't try to do
that either.)  There's no such animal as "an internal lock people don't
see" --- if we went this way it'd propagate into user-visible entries in
pg_locks, for example.

ISTM it should be sufficient to use ShareUpdateExclusiveLock.  The only
real argument I can see against it is you couldn't ANALYZE and VACUUM
a table at the same time ... but that's probably a bad idea anyway,
especially if we extend ANALYZE to estimate dead-tuple statistics.

			regards, tom lane



view thread (21+ messages)  latest in thread

Message-ID: <3024.1158266129@sss.pgh.pa.us>
Permalink:  ../3024.1158266129@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3024.1158266129@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, jd@commandprompt.com, andy@squeakycode.net, alvherre@alvh.no-ip.org, pgsql-hackers@postgresql.org
  Subject: Re: [ADMIN] Vacuum error on database postgres
  In-Reply-To: <3024.1158266129@sss.pgh.pa.us>
  References: <44F82150.5000809@pnlassociates.com> <4001.1157121669@sss.pgh.pa.us> <ee7pua$2bou$1@news.hub.org> <27602.1158238299@sss.pgh.pa.us> <45095CDD.8090704@squeakycode.net> <29469.1158247230@sss.pgh.pa.us> <45097CF4.7040409@commandprompt.com> <3024.1158266129@sss.pgh.pa.us>

* 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