Re: pg_stat_activity xact_start and autovacuum

From: Decibel! <decibel(at)decibel(dot)org>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Dawid Kuroczko <qnex42(at)gmail(dot)com>, General postgres mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_stat_activity xact_start and autovacuum
Date: 2008-02-11 23:43:46
Message-ID: 96B09899-C642-4845-8433-D3C231806C0B@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 11, 2008, at 8:14 AM, Alvaro Herrera wrote:
> Actually it's not just autovacuum; it's any lazy vacuum. It's hard to
> tell those processes apart in pg_stat_activity. Perhaps we could have
> added a column in pg_stat_activity indicating processes that don't
> hold
> old tuples, but I feel that would have been a little too much.

I don't think it'd be too hard to construct a regex that would catch
all vacuums, after which you could throw out FULLs. I'm thinking
something like

\s*vacuum((\s+full){0,1}\s+\S+){0,1};{0,1}

Where \s indicates whitespace and \S indicates not whitespace (sorry,
don't have a regex manual handy...)

You could probably even simplify that to

\s*vacuum(\s+full){0}

Of course, you'd want to perform all of those in a case-insensitive
manner.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-02-11 23:50:41 Re: postgresql book - practical or something newer?
Previous Message Greg Sabino Mullane 2008-02-11 23:38:46 DBD::Pg 2.0.0 released