Re: Postgres 8.2 and setFetchSize

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Frédéric Houbie <fh(at)ionicsoft(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Postgres 8.2 and setFetchSize
Date: 2007-09-19 13:24:35
Message-ID: 46F12313.3030401@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Frédéric Houbie wrote:

> st.setFetchSize(Integer.parseInt(args[0]));
> System.out.println("FetchSize : " + st.getFetchSize());
> String q="SELECT a FROM SValues WHERE Name = 'title'";

> It always take the same time (long time) whatever value I pass to this code for the FetchSize.

Fetch size does not directly affect query speed, it affects the number
of results the driver retrieves at once. If you've got a query that is
slow and takes a long time to return any results at all, changing the
fetchsize isn't going to help.

Since it sounds like you are getting quite different results on two
different server installations I would guess that the two databases are
not actually identical. Perhaps one is using an index but the other
isn't? Try the queries via psql, use EXPLAIN, etc.

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2007-09-19 13:26:12 Re: Postgres 8.2 and setFetchSize
Previous Message Frédéric Houbie 2007-09-19 12:12:13 Re: Postgres 8.2 and setFetchSize