X-Original-To: pgsql-performance@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 13BCA925424 for ; Wed, 28 May 2003 09:17:43 -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 33175-04 for ; Wed, 28 May 2003 09:17:41 -0400 (EDT) Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) by developer.postgresql.org (Postfix) with ESMTP id EBB3C925422 for ; Wed, 28 May 2003 09:17:39 -0400 (EDT) Received: (from root@localhost) by www.pspl.co.in (8.11.6/8.11.6) id h4SDHaa21106 for ; Wed, 28 May 2003 18:47:36 +0530 Received: from daithan.intranet.pspl.co.in (daithan.intranet.pspl.co.in [192.168.7.161]) by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h4SDHa221101 for ; Wed, 28 May 2003 18:47:36 +0530 From: Shridhar Daithankar To: pgsql-performance@postgresql.org Subject: Re: IN list processing performance (yet again) Date: Wed, 28 May 2003 18:46:38 +0530 User-Agent: KMail/1.5.2 References: <3ED4B0E5.3050703@attbi.com> In-Reply-To: <3ED4B0E5.3050703@attbi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200305281846.38928.shridhar_daithankar@nospam.persistent.co.in> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/231 X-Sequence-Number: 2010 On Wednesday 28 May 2003 18:21, Dave Tenny wrote: > Having grepped the web, it's clear that this isn't the first or last > time this issue will be raised. > > My application relies heavily on IN lists. The lists are primarily > constant integers, so queries look like: > > SELECT val FROM table WHERE id IN (43, 49, 1001, 100002, ...) How do you derive this list of number? If it is from same database, can you rewrite the query using a join statement? HTH Shridhar