X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 68C5B925079 for ; Fri, 23 May 2003 00:09:31 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 19315-08 for ; Fri, 23 May 2003 00:09:00 -0400 (EDT) Received: from tomts16-srv.bellnexxia.net (tomts16.bellnexxia.net [209.226.175.4]) by developer.postgresql.org (Postfix) with ESMTP id 03F7192573F for ; Thu, 22 May 2003 20:56:26 -0400 (EDT) Received: from [192.168.1.200] ([64.231.213.3]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030523005624.GZNV8074.tomts16-srv.bellnexxia.net@[192.168.1.200]>; Thu, 22 May 2003 20:56:24 -0400 Subject: Re: Another sub-select problem... From: Rod Taylor To: Kevin Ready Cc: pgsql-sql@postgresql.org In-Reply-To: <1053470982.3741.73.camel@localhost.localdomain> References: <1053470982.3741.73.camel@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-TIAhzNeZhnWSxWssIHDY" Organization: Message-Id: <1053651383.279.19.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 22 May 2003 20:56:24 -0400 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/444 X-Sequence-Number: 13609 --=-TIAhzNeZhnWSxWssIHDY Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > 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,7= 0, > 71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,117,133,143,145,146,178,1= 88, > 193,197) Have you tried the above in the EXISTS form? AND EXISTS (SELECT TRUE FROM block WHERE parent_component_classid IN () AND blockid =3D 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. --=20 Rod Taylor PGP Key: http://www.rbt.ca/rbtpub.asc --=-TIAhzNeZhnWSxWssIHDY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA+zXG36DETLow6vwwRAltwAJ96/sWwkAEBGCWKrNl/Le7Y13UWuACeNug0 aL0/gNG736N2mtooCgiiTDk= =mwA4 -----END PGP SIGNATURE----- --=-TIAhzNeZhnWSxWssIHDY--