Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D9FEA9FB84D for ; Fri, 18 May 2007 18:51:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 62254-01 for ; Fri, 18 May 2007 18:51:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8C2F19FB828 for ; Fri, 18 May 2007 18:51:06 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l4ILp4NL003288; Fri, 18 May 2007 17:51:05 -0400 (EDT) To: Abu Mushayeed cc: pgsql-performance@postgresql.org Subject: Re: CPU Intensive query In-reply-to: <877956.83201.qm@web57112.mail.re3.yahoo.com> References: <877956.83201.qm@web57112.mail.re3.yahoo.com> Comments: In-reply-to Abu Mushayeed message dated "Fri, 18 May 2007 09:02:52 -0700" Date: Fri, 18 May 2007 17:51:04 -0400 Message-ID: <3287.1179525064@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/351 X-Sequence-Number: 24741 Abu Mushayeed writes: > The query is as follows and it's explain plan is also attached: The query itself seems to be a simple join over not too many rows, so I don't see how it could be taking 24 hours. What I suspect is you're incurring lots and lots of invocations of those user-written functions and one of them has suddenly decided to get very slow. regards, tom lane