From: | Rod Taylor <rbt(at)rbt(dot)ca> |
---|---|
To: | Kevin Ready <kevin(at)meridianis(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Another sub-select problem... |
Date: | 2003-05-23 00:56:24 |
Message-ID: | 1053651383.279.19.camel@jester |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
> 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(at)rbt(dot)ca>
PGP Key: http://www.rbt.ca/rbtpub.asc
From | Date | Subject | |
---|---|---|---|
Next Message | Joe Conway | 2003-05-23 01:10:47 | Re: Another sub-select problem... |
Previous Message | Rod Taylor | 2003-05-23 00:41:24 | Re: tablename as attribute in pgplsql |