pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: update non-indexed value is slow if some non-related index/fk are enabled
Date: Thu, 9 Sep 2021 23:45:25 +0200
Message-ID: <YTqAda2lOs4kZFwB@hjp.at> (raw)
In-Reply-To: <CAKFQuwZXBg4C6CH7nJWO-C2qvjtkJq=MgvHN8_SYWydX7SNkng@mail.gmail.com>
References: <f5710d56-504f-46d9-986a-8ca03980363c@up.coop>
	<CAKFQuwZbx8v9Ect=FDk34FhJdCDw3ekQ=vDcKW==XaNTCiF5Cg@mail.gmail.com>
	<2875218.1630855266@sss.pgh.pa.us>
	<b67dcf853ff3ea29a60097737811e0186288362b.camel@gmail.com>
	<a0615923-0430-a31c-bef2-65580c30085e@up.coop>
	<CAKFQuwZXBg4C6CH7nJWO-C2qvjtkJq=MgvHN8_SYWydX7SNkng@mail.gmail.com>

On 2021-09-06 07:13:07 -0700, David G. Johnston wrote:
> On Monday, September 6, 2021, Philippe Doussot <philippe.doussot@up.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@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (9+ messages)

Message-ID: <YTqAda2lOs4kZFwB@hjp.at>
Permalink:  ../YTqAda2lOs4kZFwB@hjp.at/
Also on:    postgresql.org/message-id/YTqAda2lOs4kZFwB@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: update non-indexed value is slow if some non-related index/fk are enabled
  In-Reply-To: <YTqAda2lOs4kZFwB@hjp.at>
  References: <f5710d56-504f-46d9-986a-8ca03980363c@up.coop> <CAKFQuwZbx8v9Ect=FDk34FhJdCDw3ekQ=vDcKW==XaNTCiF5Cg@mail.gmail.com> <2875218.1630855266@sss.pgh.pa.us> <b67dcf853ff3ea29a60097737811e0186288362b.camel@gmail.com> <a0615923-0430-a31c-bef2-65580c30085e@up.coop> <CAKFQuwZXBg4C6CH7nJWO-C2qvjtkJq=MgvHN8_SYWydX7SNkng@mail.gmail.com> <YTqAda2lOs4kZFwB@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox