Re: Deadlocks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gena Gurchonok <gena(at)rt(dot)mipt(dot)ru>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Deadlocks
Date: 2001-01-18 21:03:57
Message-ID: 5100.979851837@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Gena Gurchonok <gena(at)rt(dot)mipt(dot)ru> writes:
> CREATE INDEX "logs_id_key" on "logs" using hash ( "id" "int4_ops" );
> CREATE INDEX "logs_type_key" on "logs" using hash ( "type" "int4_ops" );
> CREATE INDEX "logs_dt_key" on "logs" using hash ( "dt" "timestamp_ops" );

> Sometimes it writes error message
> "NOTICE: Deadlock detected -- See the lock(l) manual page for a possible cause."
> and row of course is not inserted.

> If I drop all indices on this table then such notice is not appearing.
> But I need indices on this table.

Don't use hash indexes; use the default index type (btree). hash
indexes are subject to deadlock under concurrent insertions. Besides,
they do nothing that you can't do with a btree.

regards, tom lane

In response to

  • Deadlocks at 2001-01-18 18:49:26 from Gena Gurchonok

Browse pgsql-admin by date

  From Date Subject
Next Message Jeremy Buchmann 2001-01-18 22:17:23 Re: Problems in creating table while migrating from Foxpro to Postgress using JDBC
Previous Message Bruce Momjian 2001-01-18 18:51:45 Re: Re[2]: table creation