Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A9280650162 for ; Thu, 10 Jul 2008 07:39:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93950-08 for ; Thu, 10 Jul 2008 07:39:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vilnius.balt.net (vilnius.balt.net [195.14.170.14]) by postgresql.org (Postfix) with ESMTP id 818FE65015E for ; Thu, 10 Jul 2008 07:39:08 -0300 (ADT) Received: from nSoft.lt (unknown [217.117.29.29]) by vilnius.balt.net (Postfix) with ESMTP id 0D6093A12BB; Thu, 10 Jul 2008 13:39:05 +0300 (EEST) Received: from [192.168.16.3] (unknown [192.168.16.3]) by nSoft.lt (Postfix) with ESMTP id 67078BEE07; Thu, 10 Jul 2008 14:06:55 +0000 (GMT) Message-ID: <4875E6C9.3090706@nsoft.lt> Date: Thu, 10 Jul 2008 13:39:05 +0300 From: Julius Tuskenis User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: s.borse@direction.biz CC: pgsql-admin@postgresql.org Subject: Re: query optimization References: <1215680493.2113.26.camel@dss-052.dsslp.com> <4875D589.1030107@nsoft.lt> <1215683144.2113.35.camel@dss-052.dsslp.com> In-Reply-To: <1215683144.2113.35.camel@dss-052.dsslp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.161 tagged_above=0 required=5 tests=AWL=0.161 X-Spam-Level: X-Archive-Number: 200807/102 X-Sequence-Number: 29712 Please send the "explain analyze YOUR_QUERY" output after first run and later. Also please mention platform and pg version you are using. Suresh Borse rašė: > > Good Afternoon !!! > > The view executes very faster for the first time. > > When I execute the view again and again suddenly it gets slow or it > gets hang. > > I have also traced the query plan but it changes for each > execution.Can we fix the query plan. > > I have also tested the view on my test machine but the result was same. > > The view contains multi-table joins. > > Warm Regards, > Suresh Borse > > > > On Thu, 2008-07-10 at 12:25 +0300, Julius Tuskenis wrote: >> Hello, Suresh >> >> Maybe its taking long for the first time, and then its faster? Did you >> noticed any circumstances under witch your query takes longer to execute? >> >> >> Suresh Borse rašė: >> > Dear All, >> > >> > I am facing very strange problem in postgres while executing the view. >> > >> > When I execute the view some times it takes few milliseconds, >> > sometimes it take several seconds and some times doesn't execute. >> > >> > I tried to troubleshoot using the explain plan method. But explain >> > plan also changes for each execution. >> > >> > Can anybody help me for troubleshooting and for resolving the >> > performance issue. >> > >> > >> > Thanks & Regards, >> > Suresh Borse >> > >> > >> >> >> -- Julius Tuskenis Programavimo skyriaus vadovas UAB nSoft mob. +37068233050