Re: Cursors performance - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Cursors performance
Date
Msg-id 40EF1457.1060002@opencloud.com
Whole thread Raw
In response to Cursors performance (was: Re: [PERFORM] Terrible performance after deleting/recreating indexes)  (Bill Chandler <billybobc1210@yahoo.com>)
List pgsql-jdbc
Bill Chandler wrote:

> Now the mystery is why is this happening all of the
> sudden?  I have been running w/ fetch size set to 5000
> for the last couple of weeks and it did not appear to
> be doing this (i.e. re-running the entire select
> statement again).  Is this what I should expect when
> using cursors?  I would have thought that the server
> should "remember" where it left off in the query since
> the last fetch and continue from there.

I'd check heap size, GC activity (-verbose:gc), CPU use, swapping
activity on the *client* side. It may be that your dataset size or
physical memory or something similar has changed sufficiently that GC
resulting from the data in each 5k row batch is killing you.

Can you try a trivial app that runs the same query (with same fetchsize,
autocommit, etc) via JDBC and does nothing but steps forward through the
resultset, and see how fast it runs? Perhaps the problem is in your
processing logic.

-O

pgsql-jdbc by date:

Previous
From: Bill Chandler
Date:
Subject: Re: Cursors performance (was: Re: [PERFORM] Terrible performance after deleting/recreating indexes)
Next
From: Oliver Jowett
Date:
Subject: Re: getXXX methods