Re: Postgres Hanging on Inserts

From: Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>
To: Adam Kavan <akavan(at)cox(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres Hanging on Inserts
Date: 2003-07-30 18:19:43
Message-ID: 20030730181943.GD24539@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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[(at)]dcc(dot)uchile(dot)cl>)
"The ability to monopolize a planet is insignificant
next to the power of the source"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-07-30 18:39:25 Re: Diff between contrib/dbmirror and rserv
Previous Message DeJuan Jackson 2003-07-30 18:08:29 Re: Minimal system (was Re: Basic questions before start)