Re: hash index concurrency

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: hash index concurrency
Date: 2012-05-30 13:33:48
Message-ID: CAHyXU0zVe+1D=g_th-PitLfg+m4gkaN+f2KOQdc5s2wp4t1pBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 30, 2012 at 3:49 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On 30 May 2012 04:54, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
>>> This was a hobby horse of mine a couple of years ago, but I never got
>>> much traction.  The main question I have is, what do we even want hash
>>> indexes to be?  NBTree is very good, has been extensively optimized,
>>> and extensively tested.  If there is a niche left for hash indexes,
>>> what is it?  Is it just very large keys which don't do well in BTrees,
>>> or something else?
>>
>> Well, TBH, I was hoping they'd be faster than btree.
>
> They are faster than btree in terms of response time, just not as concurrent.
>
> Right now if you have a table bigger than RAM with direct access then
> hash indexes will be faster, but I agree that the use case is not
> large enough to be worth spending the time to improve hash indexes.

Yeah -- for i/o bound lookups hash indexes can be around 2x faster for
large tables than a btree-wrapping-digest index. I confirmed this a
few months back when openly conjecturing if the hash index code should
be in fact replaced with a btree wrapper. I've never used a hash
index in a production database.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Waldecir Faria 2012-05-30 13:37:26 Re: Function call hierarchy/path since getting the buffer until access its data
Previous Message Andres Freund 2012-05-30 12:57:07 too low NAPTIME_PER_CYCLE /too many wakeups in walreceiver.c