X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B3E59D7B1E for ; Thu, 25 Aug 2005 03:52:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55618-06 for ; Thu, 25 Aug 2005 06:52:01 +0000 (GMT) Received: from mail.webhotel.net (mail.webhotel.net [217.145.49.10]) by svr1.postgresql.org (Postfix) with SMTP id 2260AD7AE5 for ; Thu, 25 Aug 2005 03:51:59 -0300 (ADT) Received: (qmail 84675 invoked from network); 25 Aug 2005 06:52:00 -0000 Received: from unknown (HELO ?192.168.42.125?) (62.66.186.164) by mail.webhotel.net with SMTP; 25 Aug 2005 06:52:00 -0000 Message-ID: <430D6A8F.6000404@netgroup.dk> Date: Thu, 25 Aug 2005 08:51:59 +0200 From: Bo Lorentsen User-Agent: Debian Thunderbird 1.0.2 (X11/20050817) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Fuhr Cc: Russell Simpkins , pgsql-sql@postgresql.org Subject: Re: Number of rows in a cursor ? References: <430C4C70.2010005@netgroup.dk> <430C6CFF.9070304@netgroup.dk> <20050824131921.GA39444@winnie.fuhr.org> <430C842C.8000504@netgroup.dk> <20050824174612.GB80642@winnie.fuhr.org> In-Reply-To: <20050824174612.GB80642@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.016 required=5 tests=[AWL=0.016] X-Spam-Level: X-Archive-Number: 200508/236 X-Sequence-Number: 22464 Michael Fuhr wrote: >Right -- when you open a cursor PostgreSQL doesn't know how many >rows it will return. PostgreSQL selects a query plan based on an >*estimate* of how many rows the query will return, but until you >fetch all the rows you can't know for sure how many rows there will >be. > > So if i make a but data set as result of a cursor I only "pay" for the rows I actually fetch ? /BL