Re: reducing statistics write overhead - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: reducing statistics write overhead
Date
Msg-id 20090121125209.GA4038@alvh.no-ip.org
Whole thread Raw
In response to reducing statistics write overhead  (Martin Pihlak <martin.pihlak@gmail.com>)
Responses Re: reducing statistics write overhead  (Martin Pihlak <martin.pihlak@gmail.com>)
List pgsql-hackers
Martin Pihlak escribió:
> I wrote:
> > I was thinking that the launcher should only request fresh stats at wakeup,
> > the workers could then reuse that file. This could be implemented by calling
> > pgstat_clear_snapshot only at launcher wakeup and setting max stats age to
> > to autovacuum_naptime for the workers.
> 
> Attached is a patch that increases the autovacuum stats age tolerance to
> autovacuum_naptime. This is handled by autovac_refresh_stats() by not clearing
> the stats snapshot unless nap time elapsed or explicitly forced by an error
> or SIGHUP.

You missed putting back the BUG comment that used to be there about
this.

In other words I think this is a bad idea, because there is a very wide
window for a table to be vacuumed twice.  Since naptime can be
arbitrarily large, this is an arbitrarily large bug.  I'm sure there are
other ways to fix this, but please propose those before this patch.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Explicitly bind gettext() to the UTF8 locale when in use.
Next
From: Simon Riggs
Date:
Subject: Pluggable Indexes (was Re: rmgr hooks (v2))