From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Matheus de Oliveira <matioli.matheus@gmail.com>
Cc: bkrug <bkrug@usatech.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Avoiding Refreezing XIDs Repeatedly
Date: Mon, 9 Feb 2015 14:06:32 -0300
Message-ID: <20150209170632.GD3391@alvh.no-ip.org> (raw)
In-Reply-To: <CAJghg4KAFiFnH6inJ+K7Bfef9bgGYt7E6MM3rkevqiT=Q245HQ@mail.gmail.com>
References: <1423497516487-5837222.post@n5.nabble.com>
<CAJghg4KAFiFnH6inJ+K7Bfef9bgGYt7E6MM3rkevqiT=Q245HQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Matheus de Oliveira wrote:
> On Mon, Feb 9, 2015 at 1:58 PM, bkrug <bkrug@usatech.com> wrote:
>
> > Couldn't postgres reserve a special XID that is never available for normal
> > transactions but that indicates that any transaction can see it because it
> > is so old? Then instead of constantly having to freeze old XIDs each time
> > the XID is going to wrap, vacuum can just set it to the special XID and
> > never touch it again unless something really changes.
> >
>
>
> It changed in recent versions (9.3 or 9.4, I don't recall exactly which)
> and moved to tuple header, but what you described is exactly what was done,
> the xid was 2.
Actually, it's been done this way for ages -- it was introduced in 2001
(release 7.2) by these commits:
Author: Tom Lane <tgl@sss.pgh.pa.us>
Branch: master Release: REL7_2 [2589735da] 2001-08-25 18:52:43 +0000
Replace implementation of pg_log as a relation accessed through the
buffer manager with 'pg_clog', a specialized access method modeled
on pg_xlog. This simplifies startup (don't need to play games to
open pg_log; among other things, OverrideTransactionSystem goes away),
should improve performance a little, and opens the door to recycling
commit log space by removing no-longer-needed segments of the commit
log. Actual recycling is not there yet, but I felt I should commit
this part separately since it'd still be useful if we chose not to
do transaction ID wraparound.
Author: Tom Lane <tgl@sss.pgh.pa.us>
Branch: master Release: REL7_2 [bc7d37a52] 2001-08-26 16:56:03 +0000
Transaction IDs wrap around, per my proposal of 13-Aug-01. More
documentation to come, but the code is all here. initdb forced.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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-performance@postgresql.org
Cc: alvherre@2ndquadrant.com, matioli.matheus@gmail.com, bkrug@usatech.com
Subject: Re: Avoiding Refreezing XIDs Repeatedly
In-Reply-To: <20150209170632.GD3391@alvh.no-ip.org>
* 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