X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CB5A4D1C4D0 for ; Wed, 30 Jul 2003 07:25:01 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 37955-06 for ; Wed, 30 Jul 2003 04:24:01 -0300 (ADT) Received: from rtlocal.trade-india.com (unknown [203.196.129.235]) by svr1.postgresql.org (Postfix) with SMTP id 0E759D1C4C9 for ; Wed, 30 Jul 2003 04:24:52 -0300 (ADT) Received: (qmail 2380 invoked from network); 30 Jul 2003 07:33:58 -0000 Received: from unknown (HELO system67.trade-india-local.com) (unknown) by unknown with SMTP; 30 Jul 2003 07:33:58 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: Tom Lane , Josh Berkus Subject: Re: Why performance improvement on converting subselect to a function ? Date: Wed, 30 Jul 2003 12:54:49 +0530 User-Agent: KMail/1.5.1 Cc: pgsql-performance@postgresql.org, "Shridhar Daithankar" References: <200307291114.29567.mallah@trade-india.com> <3F26A503.3050104@trade-india.com> <4578.1059514334@sss.pgh.pa.us> In-Reply-To: <4578.1059514334@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307301254.49159.mallah@trade-india.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/475 X-Sequence-Number: 2768 Dear Tom, the problem was repeatble in the sense repeated execution of queries made no difference on performance. What lead to degradation was the bumping off of effective_cache_size parameter from 1000 to 64K Can any one point me the recent guide done by Sridhar and Josh i want to see what i mis(read|understood) from there ;-) [ it was on GeneralBits' Home Page ] Anyway the performance gain was from 32 secs to less than a sec what i restored cache size from 64K to 1000. I will post again with more details but at the moment i got to load my data_bank :) Regds Mallah. On Wednesday 30 Jul 2003 3:02 am, Tom Lane wrote: > Rajesh Kumar Mallah writes: > > Tom Lane wrote: > >> Odd. Apparently the planner is picking a better plan in the function > >> context than in the subselect context --- which is strange since it > >> ought to have less information. > > > > [ verbose plan snipped ] > > Well, that sure seems to be the same plan. Curious that the runtime > wasn't about the same. Perhaps the slow execution of the first query > was a caching effect? If you alternate trying the query both ways, > does the speed difference persist? > > regards, tom lane