pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Bo Lorentsen <bl@netgroup.dk>
Cc: Michael Fuhr <mike@fuhr.org>
Cc: Russell Simpkins <russellsimpkins@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Number of rows in a cursor ?
Date: Thu, 25 Aug 2005 08:10:21 -0500
Message-ID: <20050825131021.GC15100@wolff.to> (raw)
In-Reply-To: <430D6A8F.6000404@netgroup.dk>
References: <B74B7433CDDD2C4AA41D94832E32E19D92EE9A@EMEXM1112.dir.svc.accenture.com>
	<430C4C70.2010005@netgroup.dk>
	<BAY103-DAV72BF461390EA073012267B5A80@phx.gbl>
	<430C6CFF.9070304@netgroup.dk>
	<20050824131921.GA39444@winnie.fuhr.org>
	<430C842C.8000504@netgroup.dk>
	<20050824174612.GB80642@winnie.fuhr.org>
	<430D6A8F.6000404@netgroup.dk>

On Thu, Aug 25, 2005 at 08:51:59 +0200,
  Bo Lorentsen <bl@netgroup.dk> wrote:
> 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 ?

There is usually some overhead for set up, though I believe quick starting
plans are favored for cursor queries.



view thread (13+ messages)

Message-ID: <20050825131021.GC15100@wolff.to>
Permalink:  ../20050825131021.GC15100@wolff.to/
Also on:    postgresql.org/message-id/20050825131021.GC15100@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, bl@netgroup.dk, mike@fuhr.org, russellsimpkins@hotmail.com
  Subject: Re: Number of rows in a cursor ?
  In-Reply-To: <20050825131021.GC15100@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox