Re: How much do the hint bits help?

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How much do the hint bits help?
Date: 2010-12-22 13:30:25
Message-ID: 4D11FD71.7050704@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22.12.2010 15:21, Simon Riggs wrote:
> On Tue, 2010-12-21 at 17:42 -0500, Merlin Moncure wrote:
>
>> *) is there community interest in a full patch that fills in the
>> missing details not implemented here?
>
> You're thinking seems sound to me. We now have all-visible flags, fewer
> xids, much better clog concurrency. Avoiding hint bits would also
> noticeably reduce number of dirty writes, especially at checkpoint.

Yep.

> Hot Standby already ignores hint bits and I've not heard a single
> complaint, so we are already doing this in the code.

No, the XMIN/XMAX committed/invalid hint bits on each heap tuple are
used during hot sandby just like during normal operation. We ignore the
index tuples marked as dead during hot standby, but that's a different
issue.

> I would vote to put this into 9.1 as a non-default option at restart,
> opening the door to other features which hint bits are frustrating.
> People can then choose between those features and the "power of hint
> bits". I think many people would choose db block checksums.

Making it optional would add some ifs in the critical paths, possibly
making it slower.

My gut feeling is that a reasonable compromise is to set hint bits like
we do today, but don't mark the page as dirty when only hint bits are
set. That way you get the benefit of hint bits for tuples that are
frequently accessed and stay in buffer cache. But you don't spend any
extra I/O to set them. I'd really like to see a worst-case scenario
benchmark of a patch that does that.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-12-22 13:59:20 Re: How much do the hint bits help?
Previous Message Magnus Hagander 2010-12-22 13:26:26 Re: [GENERAL] queriing the version of libpq