pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: SELECT very slow
Date: Thu, 09 Jun 2005 08:58:51 +0200
Message-ID: <d88p3j$mb8$2@sea.gmane.org> (raw)
In-Reply-To: <27961.1118275606@sss.pgh.pa.us>
References: <d87ood$8vq$1@sea.gmane.org>
	<27961.1118275606@sss.pgh.pa.us>

On 09.06.2005 02:06 Tom Lane wrote:

> Thomas Kellerer <spam_eater@gmx.net> writes:
> 
>>Is there anything I can do, to convince PG to return the first row more 
>>quickly?
> 
> 
> libpq's API for PQresult is such that it really doesn't have any choice
> but to collect the full result set before it hands you back the
> PQresult.  I don't know JDBC very well but I think it has similar
> semantic constraints.
> 
> The solution is to use a cursor and FETCH a reasonably small number of
> rows at a time.
> 

My understanding was that setting the fetchSize() to 1 in JDBC would force the
use of a cursor.

I'll have to go through the JDBC docs again to check how I can enforce this.

Thanks for the answer though
Thomas




view thread (19+ messages)  latest in thread

Message-ID: <d88p3j$mb8$2@sea.gmane.org>
Permalink:  ../d88p3j$mb8$2@sea.gmane.org/
Also on:    postgresql.org/message-id/d88p3j$mb8$2@sea.gmane.org

 · 

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: spam_eater@gmx.net
  Subject: Re: SELECT very slow
  In-Reply-To: <d88p3j$mb8$2@sea.gmane.org>

* 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