Re: update with no changes

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: update with no changes
Date: 2021-11-19 16:45:18
Message-ID: CAKFQuwbxNfRB0qSrp_Tjb0hZxXiozHMPdvY585GpsUWtrSu6xA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 19, 2021 at 9:38 AM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:

> If nothing was changed, why create a new record, append data to wal, set
> old record as deleted, etc, etc ?
>

Because it takes resources to determine that nothing changed. If you want
to opt-in into that there is even an extension trigger that makes doing so
fairly simple. But it's off by default because the typical case is that
people don't frequently perform no-op updates so why eat the expense.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-11-19 16:49:52 Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)
Previous Message Bharath Rupireddy 2021-11-19 16:38:47 Re: Shouldn't postgres_fdw report warning when it gives up getting result from foreign server?