Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group