Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2DE15B5DBF5 for ; Wed, 26 Oct 2011 09:57:02 -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 44357-08 for ; Wed, 26 Oct 2011 12:56:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from odzwierny2.comarch.com (odzwierny2.comarch.com [217.74.69.10]) by mail.postgresql.org (Postfix) with ESMTP id 5F3E9B5DBFC for ; Wed, 26 Oct 2011 09:56:55 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) authenticated as cezariusz.marek@comarch.com by odzwierny2.comarch.com with esmtpsa (TLSv1:RC4-MD5:128)(ComArch ESMTP) id 1RJ32N-000Li5-3A for pgsql-performance@postgresql.org; Wed, 26 Oct 2011 14:56:55 +0200 From: "Cezariusz Marek" To: References: Subject: Re: Slow cursor Date: Wed, 26 Oct 2011 14:56:51 +0200 Organization: Comarch SA Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcyT3by1TdP5OvvlQGyTL8kH+uxkLAAAGQTg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-CA-Antivirus: Scanned by ComArch Antivirus on odzwierny2.comarch.com X-CA-Is-Spam: No X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/221 X-Sequence-Number: 45443 Gregg Jaskiewicz wrote: > Do you really need to query the catalogues ? That on its own is not a > good idea if you want something to run fast and frequently. I know, but I've used it just to show the problem with cursors. I have = the same problem with other slow queries, which execute within x seconds in psql or = pgAdmin, but for loops in functions it takes at least x seconds to fetch each row. So please = just imagine, that it's an other slow query. --=20 ____________________________________________________________________ Cezariusz Marek=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = mob: +48 608 646 494 http://www.comarch.com/ =A0 tel: +48 33 815 0734 ____________________________________________________________________