Re: how many tuples on a cursor? - Mailing list pgsql-sql

From Tom Lane
Subject Re: how many tuples on a cursor?
Date
Msg-id 18483.1115046249@sss.pgh.pa.us
Whole thread Raw
In response to Re: how many tuples on a cursor?  (Christoph Haller <ch@rodos.fzk.de>)
List pgsql-sql
Christoph Haller <ch@rodos.fzk.de> writes:
> What else seems to work is MOVE 2147483647 
> (INT_MAX) and then get the max number of rows 
> by PQcmdTuples(). 

I'd suggest "MOVE FORWARD ALL" rather than hard-wiring assumptions
about the maximum possible value of infinity ;-)

> But I have no idea how expensive this MOVE is. 

The rows are all calculated internally --- about all you save compared
to a FETCH is data formatting and transmission.  If you really have to
know this number in advance of fetching the data, that's pretty much
what you have to do, but it will cost you ...
        regards, tom lane


pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: how many tuples on a cursor?
Next
From: Christoph Haller
Date:
Subject: Re: how many tuples on a cursor?