Re: Update blocking a select count(*)? - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: Update blocking a select count(*)?
Date
Msg-id 4FDB40B702000025000484EE@gw.wicourts.gov
Whole thread Raw
In response to Re: Update blocking a select count(*)?  (Benedict Holland <benedict.m.holland@gmail.com>)
Responses Re: Update blocking a select count(*)?
List pgsql-performance
Benedict Holland <benedict.m.holland@gmail.com> wrote:

> 10:25:08.329-04    vacuum (analyze, verbose, full)
> 2096    rmv    33528    postgres        8/151
> AccessExclusiveLock
> Yes    2012-06-15 10:25:08.329-04    vacuum (analyze, verbose,
> full)
> 2096    rmv    50267    postgres        8/151
> AccessExclusiveLock
> Yes    2012-06-15 10:25:08.329-04    vacuum (analyze, verbose,
> full)

You have three VACUUM FULL commands running?  VACUUM FULL is very
aggressive maintenance, which is only needed for cases of extreme
bloat.  It does lock the table against any concurrent access, since
it is completely rewriting it.

Now, if you are running UPDATE statements which affect all rows in a
table, you will *get* extreme bloat.  You either need to do such
updates as a series of smaller updates with VACUUM commands in
between, or schedule your aggressive maintenance for a time when it
can have exclusive access to the tables with minimal impact.

Reporting the other issues without mentioning the VACUUM FULL
processes is a little bit like calling from the Titanic to mention
that the ship isn't going as fast as it should and neglecting to
mention the iceberg.  :-)

-Kevin

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Update blocking a select count(*)?
Next
From: Benedict Holland
Date:
Subject: Re: Update blocking a select count(*)?