Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Thu, 20 Sep 2007 01:24:35 +1200
  • Message-id: <46F12313.3030401@opencloud.com> <text/plain>

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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group