Re: Comparing txid and xmin (under BDR)

From: Peter Mogensen <apm(at)one(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Comparing txid and xmin (under BDR)
Date: 2015-05-12 07:40:16
Message-ID: 5551AE60.3000106@one.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2015-05-12 06:06, Craig Ringer wrote:
> On 11 May 2015 at 21:10, Peter Mogensen <apm(at)one(dot)com> wrote:
>
>>
>> So ... I can easily get the current txid of the SELECT transaction by
>> calling txid_current().
>>
> Note that by doing so, you force txid allocation for a read-only query that
> might otherwise not need one, which increases your txid burn rate and
> decreases time until you need to do wraparound-protection vacuuming.
>

The same is not true for txid_snapshot_xmin() is it?

I mean ... I really don't need the actual txid of a SELECT statement.
Only to ensure that it's never than any invalidation event.
So it's enough to just use txid_snapshot_xmin() ... at the cost of
possibly not caching new values in a small window after invalidation.

/Peter

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anil Menon 2015-05-12 08:07:52 Re: Why does this SQL work?
Previous Message Wayne E. Seguin 2015-05-12 06:37:23 Re: [BDR] Node Join Question