Re: SQL spec/implementation question: UPDATE

From: Erik Jones <erik(at)myemma(dot)com>
To: Alan Hodgson <ahodgson(at)simkin(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL spec/implementation question: UPDATE
Date: 2007-10-22 16:12:51
Message-ID: 001D9701-A345-4DFE-8BEE-5EA03054AA39@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Oct 22, 2007, at 11:01 AM, Alan Hodgson wrote:

> On Sunday 21 October 2007, Kevin Hunter <hunteke(at)earlham(dot)edu> wrote:
>> Heh. And as Tom points out downthread, that "shortcut" probably
>> doesn't
>> gain anything in the long run.
>
> Considering how expensive updates are in PostgreSQL, I suspect that
> isn't
> true.

No, the idea is that the vast majority of updates aren't going to
have this happen so you're waisting cpu cycles trying to determine
beforehand if the update will have any effect. The gain from not
running updates that actually wouldn't change any table data would be
dwarfed by the overhead of making that check on every update.

>
> However, the current behaviour does seem to be logical; we did in
> fact ask
> for the row to be updated ...

Right. And, as someone else pointed out, it also allows any triggers
on the table to still run.

Erik Jones

Software Developer | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thanesh Gopal 2007-10-22 16:32:13 Investigating memory leak of trigger library using valgrind
Previous Message Dave Page 2007-10-22 16:02:27 Re: 8.2.3: Server crashes on Windows using Eclipse/Junit