From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gena Gurchonok <gena@rt.mipt.ru>
Cc: pgsql-admin@postgresql.org
Subject: Re: Deadlocks
Date: Thu, 18 Jan 2001 16:03:57 -0500
Message-ID: <5100.979851837@sss.pgh.pa.us> (raw)
In-Reply-To: <5220044251.20010118214926@rt.mipt.ru>
References: <5220044251.20010118214926@rt.mipt.ru>
Gena Gurchonok <gena@rt.mipt.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
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, gena@rt.mipt.ru
Subject: Re: Deadlocks
In-Reply-To: <5100.979851837@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