Re: DeadLocks... - Mailing list pgsql-general

From Albe Laurenz
Subject Re: DeadLocks...
Date
Msg-id AFCCBB403D7E7A4581E48F20AF3E5DB20363F4DF@EXADV1.host.magwien.gv.at
Whole thread Raw
In response to DeadLocks...  (<tom@tacocat.net>)
List 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

pgsql-general by date:

Previous
From: Erwin Brandstetter
Date:
Subject: Re: how to speed up query
Next
From: Adrian von Bidder
Date:
Subject: Q: Tree traversal with SQL query?