Re: Deadlock Problem - Mailing list pgsql-general

From Tom Lane
Subject Re: Deadlock Problem
Date
Msg-id 2642.1118845392@sss.pgh.pa.us
Whole thread Raw
In response to Re: Deadlock Problem  (Csaba Nagy <nagy@ecircle-ag.com>)
Responses Re: Deadlock Problem
List pgsql-general
Csaba Nagy <nagy@ecircle-ag.com> writes:
>> Can you explain why sorting by ID would make a difference as I don't
>> understand why what you are suggesting should make a difference?
>
> Because I guess id is your primary key, and that would make your
> transactions always update the same rows in the same order.

If the deadlocks occur because different transactions actually try to
update the same rows concurrently, then this is an appropriate solution.

However I wonder if Gavin is getting bitten by foreign key deadlocks.
Is there any foreign key reference from the stats table to other tables?

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: How to set an expiration date for a WHOLE user account
Next
From: Ericson Smith
Date:
Subject: Postgresql performance on Opteron 8 CPU