public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: Re: update behavior
Date: Thu, 19 Jun 2025 14:06:08 -0400
Message-ID: <CANzqJaCj95JOKUd_ihcba4OqHTWnqEfz67hgaRezq4a49EF-eA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>

On Thu, Jun 19, 2025 at 1:59 PM Scott Ribe <[email protected]>
wrote:

> > On Jun 19, 2025, at 11:54 AM, Rui DeSousa <[email protected]> wrote:
> >
> >
> >
> >> On Jun 19, 2025, at 1:23 PM, Scott Ribe <[email protected]>
> wrote:
> >>
> >> I believe that if I UPDATE a row with the same values that it already
> has, this still dirties pages, writes the row, generates a WAL entry. There
> is no shortcut in the processing that's "hey, there's not really a change
> here, we'll just leave storage alone".
> >>
> >> Is this correct?
> >>
> >
> > Correct, but it can be avoided.
> >
> > No update occurs in this case:.
> >
> > update foo
> >   set data = ‘hello world’
> > where id = 33
> >    and data is distinct from ‘hello world’
> > ;
>
> That was my thought when I posted the original question, when I didn't
> know about suppress_redundant_updates_trigger. Now I'm thinking the trigger
> is an option.
>
> - The trigger has the advantage that one doesn't have to maintain the
> WHERE clause--especially if the list of columns is long.
> - It has the disadvantage of always running, even in contexts where it
> might not be needed.
>

How much would fillfactor=50 (so as to enable HOT updates) mitigate the
problem?

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: update behavior
  In-Reply-To: <CANzqJaCj95JOKUd_ihcba4OqHTWnqEfz67hgaRezq4a49EF-eA@mail.gmail.com>

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

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