Re: SQL spec/implementation question: UPDATE - Mailing list pgsql-general

From Erik Jones
Subject Re: SQL spec/implementation question: UPDATE
Date
Msg-id 001D9701-A345-4DFE-8BEE-5EA03054AA39@myemma.com
Whole thread Raw
In response to Re: SQL spec/implementation question: UPDATE  (Alan Hodgson <ahodgson@simkin.ca>)
List pgsql-general
On Oct 22, 2007, at 11:01 AM, Alan Hodgson wrote:

> On Sunday 21 October 2007, Kevin Hunter <hunteke@earlham.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@myemma.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



pgsql-general by date:

Previous
From: Dave Page
Date:
Subject: Re: 8.2.3: Server crashes on Windows using Eclipse/Junit
Next
From: "Thanesh Gopal"
Date:
Subject: Investigating memory leak of trigger library using valgrind