Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 81EE94771C2 for ; Wed, 15 Jan 2003 12:40:42 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 4F116477332 for ; Wed, 15 Jan 2003 12:17:24 -0500 (EST) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) with HTTP id 2314793; Wed, 15 Jan 2003 09:17:28 -0800 From: "Josh Berkus" Subject: Re: Performance of request of type WHERE ... IN ( ... ) To: Achilleus Mantzios , Th Templ Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 Date: Wed, 15 Jan 2003 09:17:28 -0800 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/220 X-Sequence-Number: 11085 Th, > > I have performance problem of an request of type ... WHERE ... IN ( > ... ). > > How to improve performance of this type of request when a group of > id in the > > 'in' is important. > > Try WHERE ... EXISTS (...). The explanation of the difference btw. IN and EXISTS is in the PostgreSQL FAQ on the web site. -Josh