pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Continuing Technical Education <CTE@Dal.Ca>
To: Michael Richards <michael@fastmail.ca>
Cc: Pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Conditional query plans.
Date: Fri, 20 Oct 2000 09:16:55 -0300
Message-ID: <00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca> (raw)
References: <39EF613E.000005.22998@frodo.searchcanada.ca>

> 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 :)





view thread (3+ messages)

Message-ID: <00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca>
Permalink:  ../00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca/
Also on:    postgresql.org/message-id/00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: CTE@Dal.Ca, michael@fastmail.ca
  Subject: Re: Conditional query plans.
  In-Reply-To: <00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca>
  References: <39EF613E.000005.22998@frodo.searchcanada.ca> <00aa01c03a8f$a2fe8f20$5911be86@cte.Dal.Ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox