From: Rod Taylor <rbt@rbt.ca>
To: Kevin Ready <kevin@meridianis.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Another sub-select problem...
Date: 22 May 2003 20:56:24 -0400
Message-ID: <1053651383.279.19.camel@jester> (raw)
In-Reply-To: <1053470982.3741.73.camel@localhost.localdomain>
References: <1053470982.3741.73.camel@localhost.localdomain>
> AND blockID IN (SELECT blockid FROM block WHERE parent_component_classid
> IN(8,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,
> 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,
> 71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,117,133,143,145,146,178,188,
> 193,197)
Have you tried the above in the EXISTS form?
AND EXISTS (SELECT TRUE FROM block WHERE parent_component_classid IN
(<list>) AND blockid = row.blockid)
Exists as shown above will probably be significantly faster for 7.3 and
prior if parent_component_classid.blockid is indexed. In 7.4 you may
wish to try the IN style again, as there is a chance it'll be right.
--
Rod Taylor <rbt@rbt.ca>
PGP Key: http://www.rbt.ca/rbtpub.ascAttachments:
signature.asc (application/pgp-signature, 186B) download
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rbt@rbt.ca, kevin@meridianis.com
Subject: Re: Another sub-select problem...
In-Reply-To: <1053651383.279.19.camel@jester>
* 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