Re: how many tuples on a cursor?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
Cc: Andreas Kretschmer <akretschmer(at)despammed(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: how many tuples on a cursor?
Date: 2005-05-02 15:04:09
Message-ID: 18483.1115046249@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Christoph Haller <ch(at)rodos(dot)fzk(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2005-05-02 15:20:32 Re: how many tuples on a cursor?
Previous Message Christoph Haller 2005-05-02 11:17:11 Re: how many tuples on a cursor?