Re: autovacuum question

From: "Scot Kreienkamp" <SKreien(at)la-z-boy(dot)com>
To: "Greg Stark" <gsstark(at)mit(dot)edu>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Scott Mead" <scott(dot)lists(at)enterprisedb(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: autovacuum question
Date: 2010-03-09 14:48:36
Message-ID: 59E62072D4EFFF4BB912EC607F8FA60B741D44@lzbs6304.na.lzb.hq
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Would the stats come across in WAL log shipping to a physically separate server? My understanding is that they won't.

Thanks,

Scot Kreienkamp
skreien(at)la-z-boy(dot)com

-----Original Message-----
From: gsstark(at)gmail(dot)com [mailto:gsstark(at)gmail(dot)com] On Behalf Of Greg Stark
Sent: Tuesday, March 09, 2010 9:39 AM
To: Scot Kreienkamp
Cc: Tom Lane; Scott Mead; pgsql-general(at)postgresql(dot)org
Subject: Re: autovacuum question

On Tue, Mar 9, 2010 at 1:47 PM, Scot Kreienkamp <SKreien(at)la-z-boy(dot)com> wrote:
> I found a way to do it very easily using LVM snapshots and WAL log
> shipping, but the net effect is I'm bringing a new LVM snapshot copy of
> the database out of recovery every 1-2 hours.  That means I'd have to
> spend 15 minutes, or one-quarter of the time, doing an analyze every
> time I refresh the database.  That's fairly painful.  The LVM snap and
> restart only takes 1-2 minutes right now.

Your snapshot should have the same stats that the server does, so this
doesn't actually seem to explain the discrepancy.

You be running into performance problems with LVM if the snapshot is
the one paying the price for all the CoW copies. Or it could be that
doing retail block copies as needed results in them being fragmented
and destroying the sequential scan performance. You might be able to
reduce the difference by making sure to do a vacuum and a checkpoint
immediately prior to the snapshot. That would hopefully achieve
setting most hint bits so that read-only queries on the snapshot don't
cause writes to blocks just to set them.

There might be an option in LVM to materialize the entire snapshot
which might be able to bring the performance up to the same level and
hopefully allocate all the blocks sequentially.

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-03-09 14:56:22 Re: autovacuum question
Previous Message Greg Stark 2010-03-09 14:39:17 Re: autovacuum question