pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <xzilla@users.sourceforge.net>
To: pgsql-admin@postgresql.org
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Arctic Toucan <arctic_toucan@hotmail.com>
Cc: tgl@sss.pgh.pa.us
Subject: Re: Is it safe to reset relfrozenxid without using vacuum?
Date: Thu, 20 Nov 2008 14:37:06 -0500
Message-ID: <200811201437.06925.xzilla@users.sourceforge.net> (raw)
In-Reply-To: <20081118214623.GT4141@alvh.no-ip.org>
References: <BAY126-W258E8EA30779618A479BFE9C120@phx.gbl>
	<BAY126-W106E7C8FDCF0368538EEBD9C120@phx.gbl>
	<20081118214623.GT4141@alvh.no-ip.org>

On Tuesday 18 November 2008 16:46:23 Alvaro Herrera wrote:
> Arctic Toucan wrote:
> > If I "know" that there are no more inserts going into those
> > partitioned tables, can I do a bulk change of their relfrozenxids
> > setting them back 500million transactions without causing problems?
> > This will mean that the relfrozenxid is not representative of the row
> > versions, but does that matter in this case(Essentially static
> > stables)?
>
> The safest most current value you can use is that of the oldest
> transaction currently running (also known as RecentXmin in the code).
> If you choose anything older than that you're safe too.
>
> I don't think you can obtain RecentXmin in SQL (short of writing a C
> function)
>

Hmm, I have a very similar problem on some of our larger dbs with years of 
archival data. I'm of the thought that someday I will have a problem that my 
db would grow large enough that it takes longer to vacuum the archival data 
(for purposes of advancing relfrozenxid, the data is never modified) than it 
takes to run through 2 billion transactions. Sounds like the solution might 
be to write such a C function to just update this directly and run that in 
cron, and avoid the vacuum mess.  

-- 
Robert Treat
Conjecture: http://www.xzilla.net
Consulting: http://www.omniti.com



view thread (6+ messages)

Message-ID: <200811201437.06925.xzilla@users.sourceforge.net>
Permalink:  ../200811201437.06925.xzilla@users.sourceforge.net/
Also on:    postgresql.org/message-id/200811201437.06925.xzilla@users.sourceforge.net

 · 

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-admin@postgresql.org
  Cc: xzilla@users.sourceforge.net, alvherre@commandprompt.com, arctic_toucan@hotmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Is it safe to reset relfrozenxid without using vacuum?
  In-Reply-To: <200811201437.06925.xzilla@users.sourceforge.net>

* 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