Re: Rewritten rows on unchanged values - Mailing list pgsql-general

From Tom Lane
Subject Re: Rewritten rows on unchanged values
Date
Msg-id 3803.1363960514@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rewritten rows on unchanged values  (Ryan Kelly <rpkelly22@gmail.com>)
Responses Re: Rewritten rows on unchanged values
List pgsql-general
Ryan Kelly <rpkelly22@gmail.com> writes:
> I'm having trouble understanding why it is necessary to generate a new
> tuple even when nothing has changed. It seems that the OP understands
> that MVCC is at work, but is questioning why this exact behavior occurs.
> I too have the same question.

It's not *necessary* to do so.  However, avoiding it would require
sitting there and comparing the old and new tuples, which would be a
waste of cycles for most applications, which don't do useless updates.
We'd be trading off a small loss on every update for a moderate gain
on a few updates, with all of the benefit going to poorly-coded
applications.  This has come up before and we've always judged that
it would be a net loss not gain of performance to check for useless
updates.

            regards, tom lane


pgsql-general by date:

Previous
From: Ryan Kelly
Date:
Subject: Re: Rewritten rows on unchanged values
Next
From: Adrian Klaver
Date:
Subject: Re: Rewritten rows on unchanged values