Re: Hash Indexes Causing Deadlock Notices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mark <markir(at)i4free(dot)co(dot)nz>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: Hash Indexes Causing Deadlock Notices
Date: 2000-10-19 01:49:56
Message-ID: 7051.971920196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mark <markir(at)i4free(dot)co(dot)nz> writes:
> I noticed that a large number of log notice messages announcing a
> deadlock being detected together with transactions being aborted

> The tables impacted in the benchmark had HASH indexes. ( only = scans
> were being performed, it seemed a good idea at the time ..). Recreating
> these indexes as BTREE made all the messages go away. ( and produced a
> better request/s result ! )

IIRC, hash indexes use per-page locking that is not guaranteed deadlock
free. It's also bad for concurrency even when you don't get a deadlock.

The btree index type is by far the best choice we offer for
high-concurrency applications. Perhaps at some point someone will
be motivated to improve the other index types, but right now they
are definitely poor stepchildren ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-10-19 01:55:29 Re: plpgsql - cache lookup error 18977
Previous Message Larry Rosenman 2000-10-19 00:07:03 Re: [HACKERS] pg_connect error