Re: advance local xmin more aggressively - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: advance local xmin more aggressively
Date
Msg-id 1234370408.31945.43.camel@jdavis
Whole thread Raw
In response to Re: advance local xmin more aggressively  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: advance local xmin more aggressively  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, 2009-02-11 at 10:20 -0500, Robert Haas wrote:
> On Tue, Feb 10, 2009 at 3:06 PM, Jeff Davis <pgsql@j-davis.com> wrote:
> > With the new snapshot maintenance code, it looks like we can advance the
> > xmin more aggressively.
> 
> Can you clarify the circumstances in which this patch would show a
> benefit over the current system?

In the current code, if the process is always holding at least one
snapshot, the process' xmin never advances. That means VACUUM will never
be able to reclaim tuples visible during the first snapshot taken during
the transaction.

With the patch, as long as snapshots are being released, the process'
xmin will keep advancing to reflect the oldest snapshot currently held
by that process.

In order to accomplish that, every time a snapshot is released I have to
look at every snapshot that the process still holds to find the new
local minimum xmin. The current code will only change the process' xmin
if there are no snapshots at all.

As Tom pointed out, one of the assumptions I made writing the patch is
not always true. I am still trying to determine the implications of
that.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: DISCARD ALL failing to acquire locks on pg_listen
Next
From: Tom Lane
Date:
Subject: Re: A deprecation policy