Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 80BB96321AA for ; Wed, 26 May 2010 16:21:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 04988-04 for ; Wed, 26 May 2010 19:21:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 8E2CE634195 for ; Wed, 26 May 2010 16:21:37 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id B09FC2844F; Wed, 26 May 2010 15:21:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=m64MA1ih4J0F861QGLYyoCiDU7I=; b=pN1reb TRwvyvivZ1elA45Y7HrxkAVFgiPGC2ZlzKajmgNrE+G5dn4+Jlrki8YRTC/5ElyF DR5CTXjf++7EAprSINSNP2MLhm+Q6hG3tixfznH2gEEOlVjEn+L1Ap+8XkfihCKV ZeW5v+lj/8Dq4w8/ipce81veaAkuWBCVKD41A= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 850322840A; Wed, 26 May 2010 15:21:34 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id F24A0A422; Wed, 26 May 2010 15:21:33 -0400 (EDT) Date: Wed, 26 May 2010 15:21:33 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Altaf Malik cc: pgsql-jdbc@postgresql.org Subject: Re: Function with raise notice statements taking too long In-Reply-To: <34816.46946.qm@web110412.mail.gq1.yahoo.com> Message-ID: References: <34816.46946.qm@web110412.mail.gq1.yahoo.com> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 201005/71 X-Sequence-Number: 20555 On Wed, 26 May 2010, Altaf Malik wrote: > =A0I have a plpgsql function with raise notice statements in a loop. When= I > call this function from JDBC, it takes almost 5 minutes to execute. Howev= er, > if I invoke it through pgAdminIII, it gets executed in just 12 seconds. T= he > code of the function is given below: > > [plpgsql function issuing a ton of RAISE NOTICE statements] >=20 > Any clue why JDBC is performing too slow? > I've committed a fix to CVS to fix this performance issue. We were=20 only tracking the head of the SQLWarning list so adding a new warning=20 was O(N). Now we track the tail of the list as well, so adding new=20 warnings is quick. Kris Jurka=