Re: vacuum, performance, and MVCC

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: vacuum, performance, and MVCC
Date: 2006-06-23 03:02:42
Message-ID: 87k678bmlp.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The world rejoiced as tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane) wrote:
> Lukas Smith <smith(at)pooteeweet(dot)org> writes:
>> Jochem van Dieten wrote:
>>> make the session handler smarter? And if you can't do that, put some
>>> logic in the session table that turns an update without changes into a
>>> no-op?
>
>> err isnt that one the job of the database?
>
> No. That idea has been suggested and rejected before. Detecting
> that an UPDATE is a no-op would require a significant number of
> cycles, and in most applications, most or all of the time those
> cycles would be wasted effort. If you have a need for this
> behavior, you can attach a BEFORE UPDATE trigger to a table that
> checks for all-fields-the-same and suppresses the update. I don't
> think that should be automatic though.

If this be handled via a stored procedure, the stored proc could hide
this detail nice and completely...

select store_session(a,b,c,d,e);

store_session can be quite smart enough to not bother doing spurious
updates.
--
select 'cbbrowne' || '@' || 'linuxfinances.info';
http://linuxdatabases.info/info/x.html
Rules of the Evil Overlord #29. "I will dress in bright and cheery
colors, and so throw my enemies into confusion."
<http://www.eviloverlord.com/>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonah H. Harris 2006-06-23 03:20:24 Re: vacuum, performance, and MVCC
Previous Message Tom Lane 2006-06-23 02:30:17 Row comparison for tables (was Re: vacuum, performance, and MVCC)