Re: SELECT very slow - Mailing list pgsql-sql

From Thomas Kellerer
Subject Re: SELECT very slow
Date
Msg-id d89905$8c0$1@sea.gmane.org
Whole thread Raw
In response to Re: SELECT very slow  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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?
> 
> The solution is to use a cursor and FETCH a reasonably small number of
> rows at a time.

Thanks for all your answers.

I turned out that I did not read the JDBC documentation closely enough (blush)

Setting the fetchSize to 1 (or something >0) only uses a cursor if autocommit is
disabled (due to the annoying "transaction is aborted" when running DDL scripts
that have errors, I usually turn autocommit on).

With autocommit off, the rows will be returned "immediately" (so the driver is
using a cursor to fetch the data)

Regards
Thomas



pgsql-sql by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: [despammed] rejecting characters in a field
Next
From: "Dinesh Pandey"
Date:
Subject: Permission denied for language pltclu