pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Peter Schuller <peter.schuller@infidyne.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: VACUUM ANALYZE blocking both reads and writes to a table
Date: Mon, 30 Jun 2008 15:00:40 -0400
Message-ID: <3064.1214852440@sss.pgh.pa.us> (raw)
In-Reply-To: <20080630162306.GA18252@alvh.no-ip.org>
References: <20080630145903.GA15197@hyperion.scode.org>
	<20080630152515.GF10311@alvh.no-ip.org>
	<20080630154318.GB15756@hyperion.scode.org>
	<20080630162306.GA18252@alvh.no-ip.org>

Alvaro Herrera <alvherre@commandprompt.com> writes:
> Peter Schuller wrote:
>> Even with the fix the lock is held. Is the operation expected to be
>> "fast" (for some definition of "fast") and in-memory, or is this
>> something that causes significant disk I/O and/or scales badly with
>> table size or similar?

> It is fast.

Well, it's *normally* fast.  In a situation where there are a whole lot
of empty pages at the end of the table, it could be slow.  That's
probably not very likely on a heavily used table.  One should also note
that

(1) The only way vacuum will be able to obtain an exclusive lock in the
first place is if there are *no* other transactions using the table at
the time.

(2) If it's autovacuum we're talking about, it will get kicked off the
table if anyone else comes along and wants a conflicting lock.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <3064.1214852440@sss.pgh.pa.us>
Permalink:  ../3064.1214852440@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3064.1214852440@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@commandprompt.com, peter.schuller@infidyne.com
  Subject: Re: VACUUM ANALYZE blocking both reads and writes to a table
  In-Reply-To: <3064.1214852440@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