Re: Conditional query plans. - Mailing list pgsql-sql

From Continuing Technical Education
Subject Re: Conditional query plans.
Date
Msg-id 00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca
Whole thread Raw
In response to Conditional query plans.  ("Michael Richards" <michael@fastmail.ca>)
List pgsql-sql
> update users set enabled='f',disablereason='We do not allow our
> system to be used for SPAM.' where id in (select id from users where
> loginid in (select distinct loginid from logins where
> ip='123.123.12.12'));

Would it run better as:

update users set enabled='f',disablereason='We do not allow our
system to be used for SPAM.' where id in (select distinct loginid from
logins where
ip='123.123.12.12');

Or perhaps even:

update users set enabled='f',disablereason='We do not allow our
system to be used for SPAM.' where id in (select unique id from users,logins
where
users.loginid=logins.loginid where ip='123.123.12.12');

I don't know if that helps the query plan, but it looks prettier :)




pgsql-sql by date:

Previous
From: "Edmar Wiggers"
Date:
Subject: "too big" transactions
Next
From: jan.bajerski@viterra.pl
Date:
Subject: