Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2C25C65052F for ; Thu, 10 Jul 2008 06:50:17 -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 41014-10 for ; Thu, 10 Jul 2008 06:49:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ns1.aaaonlinux.net (NS1.AAAONLINUX.net [70.84.189.18]) by postgresql.org (Postfix) with ESMTP id 98024650332 for ; Thu, 10 Jul 2008 06:50:01 -0300 (ADT) Received: (qmail 23290 invoked by uid 508); 10 Jul 2008 09:55:26 -0000 Received: from unknown (HELO direction.biz) (59.163.21.147) by ns1.aaaonlinux.net with SMTP; 10 Jul 2008 09:55:25 -0000 Received: from [172.16.2.20] ([172.16.2.20]) (authenticated user s.borse@direction.biz) by direction.biz (direction.biz) (MDaemon PRO v9.0.0) with ESMTP id md50001972626.msg for ; Thu, 10 Jul 2008 15:18:05 +0530 Subject: Re: query optimization From: Suresh Borse Reply-To: s.borse@direction.biz To: Julius Tuskenis Cc: pgsql-admin@postgresql.org In-Reply-To: <4875D589.1030107@nsoft.lt> References: <1215680493.2113.26.camel@dss-052.dsslp.com> <4875D589.1030107@nsoft.lt> Content-Type: multipart/alternative; boundary="=-rkT+VYTd7fJpDg7RTVFq" Organization: DSS Date: Thu, 10 Jul 2008 15:15:44 +0530 Message-Id: <1215683144.2113.35.camel@dss-052.dsslp.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-9.fc7) X-Authenticated-Sender: s.borse@direction.biz X-Spam-Processed: direction.biz, Thu, 10 Jul 2008 15:18:05 +0530 (not processed: spam filter heuristic analysis disabled) X-MDRemoteIP: 172.16.2.20 X-Return-Path: s.borse@direction.biz X-MDaemon-Deliver-To: pgsql-admin@postgresql.org X-MDAV-Processed: direction.biz, Thu, 10 Jul 2008 15:18:07 +0530 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.202 tagged_above=0 required=5 tests=AWL=0.201, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/101 X-Sequence-Number: 29711 --=-rkT+VYTd7fJpDg7RTVFq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 > > > > > > --=-rkT+VYTd7fJpDg7RTVFq Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
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
>
>


--=-rkT+VYTd7fJpDg7RTVFq--