Re: SELECT very slow

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT very slow
Date: 2005-06-09 00:06:46
Message-ID: 27961.1118275606@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thomas Kellerer <spam_eater(at)gmx(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alain 2005-06-09 01:13:25 Re: SELECT very slow
Previous Message Keith Worthington 2005-06-08 22:44:09 [Fwd: RE: Re: Rule]