Re: DeadLocks...

From: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
To: <tom(at)tacocat(dot)net>, <pgsql-general(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: DeadLocks...
Date: 2007-06-15 07:51:21
Message-ID: AFCCBB403D7E7A4581E48F20AF3E5DB20363F4DF@EXADV1.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

tom wrote:
> I found a problem with my application which only occurs under
> high loads (isn't that always the case?).
>
> insert into tokens (token)
> select [...]
>
> This works 99% of the time.
>
> But everyone once in a long while it seems that I hit simultaneaous
> execute() statements that deadlock on the insertion.

The SELECT statement will not request a row lock and consequently
very likely has nothing to do with the deadlock.

That leaves only the INSERT itself.

What is the table definition of "tokens" (with indexes and constraints)?
Is there concurrent database activity of any kind?
What is the scope of the transaction that contains the INSERT
statement - does it contain multiple INSERT statements? Other
statements as well?

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian von Bidder 2007-06-15 08:20:32 Q: Tree traversal with SQL query?
Previous Message Erwin Brandstetter 2007-06-15 06:03:07 Re: how to speed up query