X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B4C5B4758F1 for ; Thu, 17 Apr 2003 06:00:49 -0400 (EDT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id ECD5C475458 for ; Thu, 17 Apr 2003 06:00:43 -0400 (EDT) Received: (qmail 13768 invoked from network); 17 Apr 2003 10:03:34 -0000 Received: from system67.trade-india-local.com (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 17 Apr 2003 10:03:34 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: , Subject: Re: IN Qeury Problem Date: Thu, 17 Apr 2003 15:30:45 +0530 User-Agent: KMail/1.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304171530.45076.mallah@trade-india.com> X-Spam-Status: No, hits=-33.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_SHORT_SPARSE, USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/260 X-Sequence-Number: 12961 Yes its a very well known problem and is already there in the TODO. Its going to be fixed in 7.4 release the TODO says. you can how every rewrite your query using EXISTS which is faster. regds mallah. On Friday 18 Apr 2003 12:57 am, Sameer Maggon wrote: > Hello, > > I am facing a problem regarding the performance of postgres. I am > concerned about the speed of the execution of a query when large number of > entries is given in the IN clause. > > I have a Table with columns: > > FolderName (Indexed) > FolderIndex (Indexed) > ParentFolderIndex (Indexed) > ... > .. > > I have a query where i do a SELECT > > SELECT * FROM FolderTable WHERE PARENTFOLDERINDEX IN (38::int8, ......); > > If the number of values in IN clause is small, its working fine, but as and > when the number of values increases the speed of the query is detoriating > with a steep curve. > > How can this problem be solved ? > > Thanks and Regards > Sameer Maggon > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.