Re: update non-indexed value is slow if some non-related index/fk are enabled

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: update non-indexed value is slow if some non-related index/fk are enabled
Date: 2021-09-09 21:45:25
Message-ID: YTqAda2lOs4kZFwB@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2021-09-06 07:13:07 -0700, David G. Johnston wrote:
> On Monday, September 6, 2021, Philippe Doussot <philippe(dot)doussot(at)up(dot)coop>
> wrote:
>
> I whas hopping the same optimisation as you: Write in place.
>
> How exactly would you expect “update-in-place” to work given the nature of
> MVCC?

Some databases (e.g. Oracle) store the old row in a separate place
(called an UNDO segment in Oracle) and then overwrite the row in place.
When another transaction tries to access the (not yet committed) row or
when the transaction is rolled the old row is retrieved from the undo
segment.

There are pros and cons to both approaches. Personally, I had less
problems with PostgreSQL's approach than with Oracle's.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-09-10 00:21:28 Re: Postgresql 11: terminating walsender process due to replication timeout
Previous Message Tom Lane 2021-09-09 17:39:39 Re: How to observe plan_cache_mode transition from custom to generic plan?