Re: Dead Lock problem with 8.1.3 - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Dead Lock problem with 8.1.3
Date
Msg-id 451936F4.6060007@magproductions.nl
Whole thread Raw
In response to Re: Dead Lock problem with 8.1.3  (Kai Hessing <kai.hessing@hobsons.de>)
Responses Re: Dead Lock problem with 8.1.3
List pgsql-general
Kai Hessing wrote:
> No one any idea? *sigh*
>
> Kai Hessing wrote:
>> Hi Folks,
>>
>> I have a strange Problem (to be honest there are more than one, but this
>> is one of it) after Upgrading to Postgres 8.1.3. The following SQL seems
>> to produce a deadlock while doing an endless reading of a temp table:
>>
>> SELECT s.sid FROM stud s, stud_vera v WHERE s.sid = v.sid AND v.veraid =
>> 34 AND s.sid NOT IN ( SELECT sid FROM stud_vera WHERE veraid = 2 );

I'm pretty sure it's not a deadlock. It probably takes very long for
some reason; maybe an explain of that query will give some insight. You
probably lack some indices.

Alternatively, have you tried an EXCEPT query? I think this is what you
try to query:

SELECT s.sid FROM stud s, stud_vera v WHERE s.sid = v.sid AND v.veraid = 34
EXCEPT
SELECT s.sid FROM stud s, stud_vera v WHERE s.sid = v.sid AND v.veraid = 2


--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: change the order of FROM selection to make query work
Next
From: Joe Conway
Date:
Subject: Re: Dead Lock problem with 8.1.3