Re: Do we need so many hint bits? - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: Do we need so many hint bits?
Date
Msg-id CABOikdPXKgnkMdcmq8F7K6R9ZbLeQdZZqy4DjyDrxLwqGPJ0gg@mail.gmail.com
Whole thread Raw
In response to Re: Do we need so many hint bits?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Do we need so many hint bits?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On Fri, Nov 16, 2012 at 8:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jeff Davis <pgsql@j-davis.com> writes:

> Removing those 3 hints would give us 3 more flag bits (eventually, after
> we are sure they aren't just leftover), and it would also reduce the
> chance that a page is dirtied for no other reason than to set them.

We aren't pressed for flag bits particularly.  I think the main
attraction of this idea is precisely to reduce unnecessary page dirties,
and so that leads me to suggest a variant: keep the four bits defined as
now, but do not attempt to set XMIN_INVALID or XMAX_COMMITTED unless the
page is already dirty.  

Another approach could be to set those additional bits, but don't dirty the page. So if the page is already dirty or gets dirty later on before its eviction, those hint bits will get recorded. We can also try some other variants like: set the bits and dirty the page if the XID is beyond the horizon that CLOG buffers can track. A very old XID will most likely cause a CLOG page read later on.

I forgot if we have a way to differentiate between critical and non-critical dirtiness of a page. If we don't, that might be another worthwhile thing to try and test. Setting hint bits is a non-critical operation. So such a dirty page may be discarded if the system is under pressure.

Well, all of the above may have been discussed and rejected in the past. What we need is a thorough benchmarking to know what is better in which situation.

Thanks,
Pavan

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Do we need so many hint bits?
Next
From: Simon Riggs
Date:
Subject: Re: feature proposal - triggers by semantics