Re: Number of rows in a cursor ?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Russell Simpkins <russellsimpkins(at)hotmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Number of rows in a cursor ?
Date: 2005-08-25 13:10:21
Message-ID: 20050825131021.GC15100@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Aug 25, 2005 at 08:51:59 +0200,
Bo Lorentsen <bl(at)netgroup(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-08-25 13:19:58 Re: How this query!
Previous Message Lars Haugseth 2005-08-25 12:21:20 Re: How this query!