Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4B4A49FA5E0 for ; Wed, 19 Sep 2007 10:24:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 35177-03 for ; Wed, 19 Sep 2007 10:24:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id C884A9FA5C4 for ; Wed, 19 Sep 2007 10:24:25 -0300 (ADT) Received: from 222-154-139-67.jetstream.xtra.co.nz ([222.154.139.67] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IXzXO-0002mX-Sa; Thu, 20 Sep 2007 01:24:19 +1200 Message-ID: <46F12313.3030401@opencloud.com> Date: Thu, 20 Sep 2007 01:24:35 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Fr=E9d=E9ric_Houbie?= CC: pgsql-jdbc@postgresql.org Subject: Re: Postgres 8.2 and setFetchSize References: <95484F7A889A61469885286054F675DD512526@altarf.ionicsoft.com> In-Reply-To: <95484F7A889A61469885286054F675DD512526@altarf.ionicsoft.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/97 X-Sequence-Number: 17519 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