Re: how many tuples on a cursor?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how many tuples on a cursor?
Дата
Msg-id 18483.1115046249@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: how many tuples on a cursor?  (Christoph Haller <ch@rodos.fzk.de>)
Список 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 по дате отправления:

Предыдущее
От: Christoph Haller
Дата:
Сообщение: Re: how many tuples on a cursor?
Следующее
От: Christoph Haller
Дата:
Сообщение: Re: how many tuples on a cursor?