pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: Andreas Kretschmer <akretschmer@despammed.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: how many tuples on a cursor?
Date: Mon, 02 May 2005 11:04:09 -0400
Message-ID: <18483.1115046249@sss.pgh.pa.us> (raw)
In-Reply-To: <42760C37.BD6531A8@rodos.fzk.de>
References: <20050502071358.GB5962@webserv.wug-glas.de>
	<42760C37.BD6531A8@rodos.fzk.de>

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



view thread (4+ messages)  latest in thread

Message-ID: <18483.1115046249@sss.pgh.pa.us>
Permalink:  ../18483.1115046249@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18483.1115046249@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ch@rodos.fzk.de, akretschmer@despammed.com
  Subject: Re: how many tuples on a cursor?
  In-Reply-To: <18483.1115046249@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox