Re: Number of rows in a cursor ?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: Russell Simpkins <russellsimpkins(at)hotmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Number of rows in a cursor ?
Date: 2005-08-24 13:19:22
Message-ID: 20050824131921.GA39444@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Aug 24, 2005 at 02:50:07PM +0200, Bo Lorentsen wrote:
> Russell Simpkins wrote:
> >If you need a count, why not just execute one of the methods to get a
> >count. i.e.e select count(id) ...
>
> The reason why i don't just make a count and then a selection of data
> is performance.

...which is the same reason a cursor doesn't know how many rows it will
fetch until you fetch them all (or MOVE to the end of the cursor,
which fetches the rows internally).

--
Michael Fuhr

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josep SanmartĂ­ 2005-08-24 13:46:09 How to join several selects
Previous Message Bo Lorentsen 2005-08-24 12:50:07 Re: Number of rows in a cursor ?