Re: Conditional query plans.

From: "Continuing Technical Education" <CTE(at)Dal(dot)Ca>
To: "Michael Richards" <michael(at)fastmail(dot)ca>
Cc: "Pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Conditional query plans.
Date: 2000-10-20 12:16:55
Message-ID: 00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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 :)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pete Forman 2000-10-20 13:04:16 Re: Add support for <xti.h>
Previous Message Zeugswetter Andreas SB 2000-10-20 08:52:22 AW: AW: Backup, restore & pg_dump

Browse pgsql-sql by date

  From Date Subject
Next Message Keith Kratochvil 2000-10-20 13:52:35 Re: what is the best way to set-up keywords in tables and Queries ?
Previous Message pgsql-sql 2000-10-20 10:48:54 help on creating table