Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DE78DB5DCEC for ; Wed, 26 Oct 2011 10:10:57 -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 64140-07 for ; Wed, 26 Oct 2011 13:10:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id 63354B5DC68 for ; Wed, 26 Oct 2011 10:10:51 -0300 (ADT) Received: from intern.anarazel.de (p57A9EDF3.dip.t-dialin.net [87.169.237.243]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPA id A25D1448006; Wed, 26 Oct 2011 15:10:48 +0200 (CEST) From: Andres Freund To: pgsql-performance@postgresql.org Subject: Re: Slow cursor Date: Wed, 26 Oct 2011 15:10:46 +0200 User-Agent: KMail/1.13.7 (Linux/3.0.0-2-amd64; KDE/4.6.5; x86_64; ; ) Cc: "Cezariusz Marek" References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Message-Id: <201110261510.46828.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/222 X-Sequence-Number: 45444 Hi, On Wednesday 26 Oct 2011 14:43:08 Cezariusz Marek wrote: > Is there any known problem with slow cursors in PostgreSQL 8.4.5? > > I have a following query, which is slow (on my database it takes 11 seconds > to execute), probably should be rewritten, but it doesn't matter here. The > problem is, that in cursor, each fetch takes much longer (even few > minutes!), while only the first one should be slow. Am I doing something > wrong? Does the problem persist if you play around with cursor_tuple_fraction? Andres