Re: Update on tables when the row doesn't change - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Update on tables when the row doesn't change
Date
Msg-id 20050525161614.GC15818@svana.org
Whole thread Raw
In response to Re: Update on tables when the row doesn't change  ("Tim Vadnais" <tvadnais@earthlink.net>)
List pgsql-general
On Wed, May 25, 2005 at 08:41:23AM -0700, Tim Vadnais wrote:
> Hi All,
>
> Can someone please address this aspect of Sebastian's email?  I, too, am
> interested in the response.
>
> >> Why does Postgres perform an update on the table even
> >> if no data changes?
> >> Can I circumvent this behaviour of Postgres?

Tom did, AFAIK. Basically, it's a non-zero cost to check for something
that's useless in 99.99% of cases. Secondly, if you have a update
trigger on the table, it applies to all updates, even if they don't
change the actual data. If you didn't want to update the row, don't
issue it in the first place.

If you want to block the update, create your own trigger to detect it
and drop it. Most people don't need it.

That's completely seperate to his issue with reevaluating the view,
where I've seen no response to the question about what he thinks
PostgreSQL should be doing. You know, the query plan he get vs what he
actually wants.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Update on tables when the row doesn't change
Next
From: Manuel García
Date:
Subject: Advice