pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Frédéric Houbie <fh@ionicsoft.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Postgres 8.2 and setFetchSize
Date: Thu, 20 Sep 2007 01:24:35 +1200
Message-ID: <46F12313.3030401@opencloud.com> (raw)
In-Reply-To: <95484F7A889A61469885286054F675DD512526@altarf.ionicsoft.com>
References: <95484F7A889A61469885286054F675DD512526@altarf.ionicsoft.com>

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



view thread (7+ messages)  latest in thread

Message-ID: <46F12313.3030401@opencloud.com>
Permalink:  ../46F12313.3030401@opencloud.com/
Also on:    postgresql.org/message-id/46F12313.3030401@opencloud.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, fh@ionicsoft.com
  Subject: Re: Postgres 8.2 and setFetchSize
  In-Reply-To: <46F12313.3030401@opencloud.com>
  References: <95484F7A889A61469885286054F675DD512526@altarf.ionicsoft.com> <46F12313.3030401@opencloud.com>

* 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