From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: SELECT very slow
Date: Thu, 09 Jun 2005 13:30:08 +0200
Message-ID: <d89905$8c0$1@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?
>
> 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
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: <d89905$8c0$1@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