Re: WIP patch for hint bit i/o mitigation - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: WIP patch for hint bit i/o mitigation
Date
Msg-id CAHyXU0xM1_8TQnYx9avy_OPtcLhXzcNY_LbJU+n8gmVwEcDqxg@mail.gmail.com
Whole thread Raw
In response to Re: WIP patch for hint bit i/o mitigation  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: WIP patch for hint bit i/o mitigation  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Thu, Nov 15, 2012 at 6:42 PM, Jeff Davis <pgsql@j-davis.com> wrote:
> On Tue, 2012-11-06 at 17:55 -0600, Merlin Moncure wrote:
>> So given that -- the patch simple adds an extra check when/where hint
>> bit status is checked in the visibility routines (currently, only
>> HeapTupleSatisfiesMVCC is done but all the applicable visibility
>> routines should be done).  Basically, the way it works is like this:
>>
>> *) is hint bit set?
>> *) if not? does the examined xid match the last examined one?
>> *) if so, and the cached hint bit matches the one want, proceeed as if
>> hint bit was set
>
> Can you clarify the difference between this and
> cachedFetchXid/cachedFetchXidStatus? Do we need to keep those if your
> patch is accepted?

Very little, except:
*) transam.c managed cache is unable to influence the specific code
path through the visibility routines, at least not without significant
refactoring -- everything that happens in tqual.c should be inlined.
I played with doing it all in transam.c a while back and didn't much
like how it turned out.  That doesn't mean it can't work though.

*) There are a couple of important looking code paths that communicate
directly with transam.c.   For example, in procarray.c
ProcArrayApplyRecoveryInfo().  Removing transam.c cache could turn
into fairly significant regression if that code is performance
sensitive -- that would have to be studied before doing that.

Maybe abstracting 'last xid cache'  along with hint bit management out
of both transam.c and tqual.c into something like 'hints.c' is
appropriate, but that's a more invasive change.

merlin



pgsql-hackers by date:

Previous
From: Cédric Villemain
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL
Next
From: Hannu Krosing
Date:
Subject: Re: another idea for changing global configuration settings from SQL