Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWzVO-00FBqX-0W for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 16:08:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWzUM-00Abk5-0h for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 16:07:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWzUL-00Abjx-2l for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 16:07:26 +0000 Received: from mail-oo1-xc32.google.com ([2607:f8b0:4864:20::c32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWzUK-001gZ9-2j for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 16:07:25 +0000 Received: by mail-oo1-xc32.google.com with SMTP id 006d021491bc7-65b6b69baf8so604951eaf.3 for ; Sat, 20 Dec 2025 08:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766246843; x=1766851643; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+mYt3z3bvM0+APFBRdCItdJhxsj7WgkzNmnf0mkSnK0=; b=ij0+3dI0B7n/596sRhXzNbgRC0tMbqPjxBeHCA7dLuXjy0T+EJtKMmtbObPndXdsnu 60eDG8Pu5S2wG0oFspiQpzBeRvCcCn4SRJw/ZjFdiaLQb6MrNSY0l0+ceZoruNYVoMgF lxlDK8zaLBYwn7SznSuylHLUSkDaf4sE/j3M8cxW5yRokPoaZTBtIxh9GwF5Qo9ADu3z vDSD1FwcEwUfQUQuj61xBJozW02dzqjb7ESDh2uymyg7a5GrcMu/t0/VedEYN6mJtxWo KvzrnfrzTYM0CiMyaFKi9p0xUdKFmoRvtDP9YYyVD4R+Zgi8LDI2TOCT9wxlhn60jG10 JgHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766246843; x=1766851643; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+mYt3z3bvM0+APFBRdCItdJhxsj7WgkzNmnf0mkSnK0=; b=Gf81E5GVUCOSEb7Zx0yQZlG4h9ein8Cn7ZPSMkh9bZBoZwjOknqJMRME1uJQVKfU9A u1Td0hXk19Fx00Cijngbmcer1ANTnoo3qd3MIT9sI84V2+avnqUXWkoZ6DQzex3Iru7G nq3/uGit/+A98cFTmZwisJLsDBTRHeudU3/1Q0gc4nEVp8768+Im6DxN8EF8zrmZeCdS 5yNcnVjhtSfVFBhUBdxxQ1PN8uvTVErKHrHhYyZUv1R09hNB75qwJXpiyGT8FpXdh/fZ 9DozlQBf6m70Q913SOiyVx8UbLBah31shiYvbPhXJ8W2KyZ07nXcBSqcHlP5PftxYxfJ YDdQ== X-Gm-Message-State: AOJu0YyW2kb/MNYxyzU7ZidzMxNj2q72I1StGlAc+mjiId5C/c0cns+F SdkU9Ot9FVUbv/PDAki1GfM+phoMO+ChTpLHnqalOXjYBeO5h3Ify8NGDJjqS47qyVULI1wNQcm ntDvN1cZDiAkie+NUCL8nez2kR9QggYw= X-Gm-Gg: AY/fxX4k6mrYP9FLzSvqjdOdvoa2u99v2TWddQqmHNfDy4Cr4N446OL5IDX9FG5pdI0 dntpy/EmqirPvOnrw+ix7NZ54Zs60YMxe27Q64Ma1cEkzbhQMAVLhRcqR3LZPPl4+5XCKfGzcNG bxNwr9ECPRkyJs5z7BbSfB1hjVkrZyTgyJ+9GL503Go70g4foy1aW9mGxV6ud5Di5iFb6J9JW6L i9PeDOXVbTN5wcCUsGoeMooLwIopG+6nMl8oxgbeizb6BxxYqVyMs/tYZFBv+mS1gMWlWe+bHJa 4kHxE90eb+yN+9JVnrAwokiyRLg= X-Google-Smtp-Source: AGHT+IG85tKyoLpg3OxKwDeqUyTMG9KFn9LYJyUbBSIrcR5xSOkzLe3+KL3ZZKAJ/cI5akeh6eMidnDUoxlUvy7cHgE= X-Received: by 2002:a05:6820:8606:b0:659:9a49:8e50 with SMTP id 006d021491bc7-65d0e9fc2c9mr1624217eaf.32.1766246843173; Sat, 20 Dec 2025 08:07:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Corey Huinker Date: Sat, 20 Dec 2025 11:07:11 -0500 X-Gm-Features: AQt7F2qBldwNVGFQdcM980gvOeHxGEhw6rp2GNnx9nRP1DADJOEfjJFIWkyCN70 Message-ID: Subject: Re: SQL-level pg_datum_image_equal To: Matthias van de Meent Cc: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000ac53dd0646646367" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ac53dd0646646367 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 10, 2025 at 12:46=E2=80=AFPM Matthias van de Meent < boekewurm+postgres@gmail.com> wrote: > Hi, > > One of our customers has this workload where every so often they > update the whole table to make sure it's up-to-date. In general, you'd > probably want to use MERGE for such a workload and ignore all rows > that already have only matching data, but there's a catch: PostgreSQL > doesn't have an efficient way to check if the provided data is > actually equal in all senses of the word, so we can't easily and > cheaply determine whether an update is needed; which is one reason why > the full table was updated every time. > Have you ruled out the suppress_redundant_updates_trigger? https://www.postgresql.org/docs/current/functions-trigger.html --000000000000ac53dd0646646367 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 10, 2025 at 12:46=E2=80=AFPM Matt= hias van de Meent <boe= kewurm+postgres@gmail.com> wrote:
Hi,

One of our customers has this workload where every so often they
update the whole table to make sure it's up-to-date. In general, you= 9;d
probably want to use MERGE for such a workload and ignore all rows
that already have only matching data, but there's a catch: PostgreSQL doesn't have an efficient way to check if the provided data is
actually equal in all senses of the word, so we can't easily and
cheaply determine whether an update is needed; which is one reason why
the full table was updated every time.

= Have you ruled out the=C2=A0suppress_redundant_updates_trigger?
<= br>
--000000000000ac53dd0646646367--