pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Klemme <shortcutter@googlemail.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: Stefan Keller <sfkeller@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Peter Geoghegan <peter@2ndquadrant.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Hash index use presently(?) discouraged since 2005: revive or bury it?
Date: Mon, 19 Sep 2011 11:35:38 -0400
Message-ID: <17650.1316446538@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM9pMnNUoOnLye5iPqGu15K43Nus=xtCL_rRW5LRt3UJ3vqDQQ@mail.gmail.com>
References: <CAFcOn293Rzi7cZYWBT8tjxCtNX5pYdbknANXgf9mWfBizK8Frg@mail.gmail.com>
	<CAEYLb_Udue8_XSE9K0KMqKBE_62yurv1bY4Wc+qJoGykZ_rXtA@mail.gmail.com>
	<CAMkU=1x7EsbLh8oxYtXKWzDx5HUDxQ2Vb4sFDCVY0FE8rnttSg@mail.gmail.com>
	<CAHyXU0wPJkYhQLioswNRe6YmXcC_JKZmDxXsb1jcLHo8+BuJkw@mail.gmail.com>
	<CAFcOn2_NnrzquFQ+YPw2vh=ioC+KXcE1NdEJZWG4O7pmY1Eu3Q@mail.gmail.com>
	<CAHyXU0yExA3sBDy1o1vJ57g5pTV5MQ_Z7HXhBo9Pv0+Zg-moHg@mail.gmail.com>
	<CAM9pMnNUoOnLye5iPqGu15K43Nus=xtCL_rRW5LRt3UJ3vqDQQ@mail.gmail.com>

Robert Klemme <shortcutter@googlemail.com> writes:
> I still haven't seen a solution to locking when a hash table needs
> resizing.  All hashing algorithms I can think of at the moment would
> require a lock on the whole beast during the resize which makes this
> type of index impractical for certain loads (heavy updating).

That seems rather drastically overstated.  The existing hash index code
only needs to hold an index-scope lock for a short interval while it
updates the bucket mapping information after a bucket split.  All other
locks are per-bucket or per-page.  The conflicting share-lockers of the
index-wide lock also only need to hold it for a short time, not for
their whole indexscans.  So that doesn't seem to me to be materially
worse than the locking situation for a btree, where we also sometimes
need exclusive lock on the btree root page, thus blocking incoming
indexscans for a short time.

			regards, tom lane



view thread (40+ messages)  latest in thread

Message-ID: <17650.1316446538@sss.pgh.pa.us>
Permalink:  ../17650.1316446538@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17650.1316446538@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, shortcutter@googlemail.com, mmoncure@gmail.com, sfkeller@gmail.com, jeff.janes@gmail.com, peter@2ndquadrant.com
  Subject: Re: Hash index use presently(?) discouraged since 2005: revive or bury it?
  In-Reply-To: <17650.1316446538@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox