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

Re: refreshRow is slow

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: "John T(dot) Dow" <john(at)johntdow(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: refreshRow is slow
Date: 2010-01-15 00:37:58
Message-ID: 4B4FB8E6.7040008@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
John T. Dow wrote:

> Each row in a postgres database has a unique identifier. I would think that refreshrow could use that to target the specific row to be refreshed.

refreshRow() uses the primary key of the table to synthesize a SELECT to 
pick out just the one row, yes. If you explicitly select a column called 
"oid" in your query, it'll use that instead of the PK columns.

(I looked at that code and there are a few ways to confuse it. That's 
why I want to know what the actual query that's causing problems is.)

> 
> I realize that I only want to refresh one row, and that refreshrow actually uses the fetch size and may get more than one if required. Refreshing many rows using their unique identifiers might not be desirable.

Huh? Fetch size should have no effect on refreshRow() - it should only 
be selecting a single row anyway.

Again: What is the actual query being synthesized by refreshRow(), and 
have you tried analysing that query to work out why it's slow?

Also, if you just want to do an UPDATE and have the freshly updated data 
appear in your resultset, why don't you use the ResultSet update 
interface? updateRow() populates the ResultSet row with the data sent to 
the backend as part of the update.

-O


In response to

pgsql-jdbc by date

Next:From: SJ KissaneDate: 2010-01-15 01:27:21
Subject: Bug in AbstractJdbc2BlobClob
Previous:From: John T. DowDate: 2010-01-14 23:59:36
Subject: Re: refreshRow is slow

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group