How much do the hint bits help?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: How much do the hint bits help?
Date: 2010-12-21 22:42:32
Message-ID: AANLkTi=z15_FEeKKg+KiHRx2xk4Oy5iyZ-uRRiMgViiE@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've been playing around with postgresql hint bits in order to teach
myself more about the internals of the MVCC system.  I noticed that
the hint bit system has been around forever (Vadim era) and predates
several backend improvements that might affect their usefulness.  So I
started playing around, trying to quantify the benefit they provide
with an eye of optimizing clog lookups if it turned out to be
necessary say by mmap-ing a big transaction status file just to see if
that helped.

Attached is an incomplete patch disabling hint bits based on compile
switch.  It's not complete, for example it's not reconciling some
assumptions in heapam.c that hint bits have been set in various
routines.  However, it mostly passes regression and I deemed it good
enough to run some preliminary benchmarks and fool around.  Obviously,
hint bits are an annoying impediment to a couple of other cool pending
features, and it certainly would be nice to operate without them.
Also, for particular workloads, the extra i/o hint bits can cause a
fair amount of pain.

So far, at least doing pgbench runs and another test designed to
exercise clog lookups, the performance loss of always doing full
lookup hasn't materialized.  Note that in these cases the clog lru
cache is pretty effective, and it's pretty likely I may have blown it
in some other way, so take the results for a grain of salt.   But,
here are the following questions/points:

*) relative to when the hint bits where implemented, the amount of
transactions to map has shrunk, while hardware has improved by a
couple of orders of magnitude.  Also the postgres architecture has
changed considerably.  Are they still necessary?

*) what's a good way to stress the clog severely? I'd like to pick a
degenerate case to get a better idea of the way things stand without
them.

*) is there community interest in a full patch that fills in the
missing details not implemented here?

merlin

Attachment Content-Type Size
disble_hints.diff text/x-patch 49.4 KB
clog_stress.sql text/x-sql 255 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-21 22:59:56 Re: Comment typo in nodeWindowAgg.c
Previous Message Robert Haas 2010-12-21 22:15:44 Re: [FeatureRequest] Base Convert Function