pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: John T. Dow <john@johntdow.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: refreshRow is slow
Date: Fri, 15 Jan 2010 13:37:58 +1300
Message-ID: <4B4FB8E6.7040008@opencloud.com> (raw)
In-Reply-To: <201001150000.o0F003j8000495@web2.nidhog.com>
References: <201001150000.o0F003j8000495@web2.nidhog.com>

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




view thread (12+ messages)  latest in thread

Message-ID: <4B4FB8E6.7040008@opencloud.com>
Permalink:  ../4B4FB8E6.7040008@opencloud.com/
Also on:    postgresql.org/message-id/4B4FB8E6.7040008@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, john@johntdow.com
  Subject: Re: refreshRow is slow
  In-Reply-To: <4B4FB8E6.7040008@opencloud.com>
  References: <201001150000.o0F003j8000495@web2.nidhog.com> <4B4FB8E6.7040008@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