Re: Postgres Hanging on Inserts - Mailing list pgsql-general

From Alvaro Herrera Munoz
Subject Re: Postgres Hanging on Inserts
Date
Msg-id 20030730181943.GD24539@dcc.uchile.cl
Whole thread Raw
In response to Re: Postgres Hanging on Inserts  ("Adam Kavan" <akavan@cox.net>)
Responses Re: Postgres Hanging on Inserts  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Jul 30, 2003 at 01:03:55PM -0500, Adam Kavan wrote:

> I have found the problem (I think) below is the list of all the locks
> pending on the relation.  The relation is a hash index on the table that is
> being INSERT'd rapidly.  From what I can see pid 10024 and 10025 both have
> an ExclusiveLock on the index, and they both are waiting to get an
> ExclusiveLock on the relation.

Oh, so this is the problem.  Truth is hash indexes in Postgres are known to
have poor concurrency, though I didn't expect them to be subject to
deadlocks...  you should change the hash index to a btree index and the
problem will "go away"; you will also probably see a performance improvement
if there's concurrent insertion and access.  BTrees are way more developed
than hashes.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"The ability to monopolize a planet is insignificant
next to the power of the source"

pgsql-general by date:

Previous
From: DeJuan Jackson
Date:
Subject: Re: Minimal system (was Re: Basic questions before start)
Next
From: Dennis Gearon
Date:
Subject: Re: Diff between contrib/dbmirror and rserv