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.94.2) (envelope-from ) id 1uSvEp-00ErmK-Sr for pgsql-admin@arkaria.postgresql.org; Sat, 21 Jun 2025 10:14:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSvEn-006rs6-Vq for pgsql-admin@arkaria.postgresql.org; Sat, 21 Jun 2025 10:14:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSJVy-00Dd88-6a for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:57:30 +0000 Received: from p-east2-cluster4-host10-snip4-6.eps.apple.com ([57.103.78.227] helo=outbound.st.icloud.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uSJVw-002zOv-2K for pgsql-admin@lists.postgresql.org; Thu, 19 Jun 2025 17:57:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=H+7veLcfhNYBSdYEMi1ri6+pVj2NMLkYloSo7e6ShCA=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To:x-icloud-hme; b=pyutLiyWJHM+vDLOFoXMiRKrLGH+hDTpsoPYtcfZgxKPAY4IwA00ceH8uErq8NNLv LRg0N2bb826jJU3K/a3UtT2DF4SkuTBltS2tf8Nzi2i0CQz5wx3GUL8vahX9QEU6R3 SdWCF7nWqagMvLZtKZYKk6nx7JX5t4M6s+pcdZrmJJq4e+m3eAkrCDswmpSjEhLMzj upb6vb+QwCNuYL8y6PlIrOBaDHmSYHuA0x/dmDyIiQoyvO3oX3FnuglgmebKh6mS+M Sb6F3eSjEu8qY1loITKzcDfEbZX0kz3bC/3ubhgIQ57eK/HzYtYnWWCuKh8+rGrdth xu2dy0Jw7mFDQ== Received: from outbound.st.icloud.com (unknown [127.0.0.2]) by outbound.st.icloud.com (Postfix) with ESMTPS id 45C1A1800226; Thu, 19 Jun 2025 17:57:25 +0000 (UTC) Received: from smtpclient.apple (st-asmtp-me-k8s.p00.prod.me.com [17.42.251.67]) by outbound.st.icloud.com (Postfix) with ESMTPSA id E47801800642; Thu, 19 Jun 2025 17:57:23 +0000 (UTC) From: Rui DeSousa Message-Id: <5354269F-0A69-48E6-8BFA-C118B75970C3@icloud.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_93C71D1F-5172-4B9E-B2CB-EC99488F5239" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: update behavior Date: Thu, 19 Jun 2025 13:57:20 -0400 In-Reply-To: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> Cc: Pgsql-admin To: Scott Ribe References: <75F792AF-58DF-4559-A2E8-C89060D1E94E@elevated-dev.com> X-Mailer: Apple Mail (2.3696.120.41.1.10) X-Proofpoint-GUID: VCa-vXjLWNMjvtjA3nO1QxrZNwWlJ6ZJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjE5MDE0OCBTYWx0ZWRfXyHUw5mMwiYI3 MogOGU1nzYpuYgUYKDKhMCOENTwgATYAhqULx6uXow2HGLL+w098rxBioEM62E8XvwePXJcf+Dv qfBrTc2W355D54/JXSZ8Jp72rxsMk2UJR3Km5aPUJ66vLFUrVsEnUtWFSrzkKmyRCQIMHqYyvc0 7TP9y6++Qf72EkPCPoslTfLrPs3N2wQhXwS+kypx3tO/vvgwFdtcQ/8skYmF3HtGbxfUordfztz Z1Hsv03hUE4FVX+MXyBGM1s8AZY26EEnRWJgxoyncHhw1tfrHz9ekf7jUdp+4NFC/doHodswE= X-Proofpoint-ORIG-GUID: VCa-vXjLWNMjvtjA3nO1QxrZNwWlJ6ZJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-19_06,2025-06-18_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=954 phishscore=0 spamscore=0 clxscore=1011 malwarescore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506060001 definitions=main-2506190148 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_93C71D1F-5172-4B9E-B2CB-EC99488F5239 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 19, 2025, at 1:23 PM, Scott Ribe = wrote: >=20 > 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". >=20 > Is this correct? >=20 >=20 Correct, but it can be avoided.=20 No update occurs in this case:.=20 update foo set data =3D =E2=80=98hello world=E2=80=99 where id =3D 33 and data is distinct from =E2=80=98hello world=E2=80=99 ; --Apple-Mail=_93C71D1F-5172-4B9E-B2CB-EC99488F5239 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On = Jun 19, 2025, at 1:23 PM, Scott Ribe <scott_ribe@elevated-dev.com> 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 =3D =E2=80=98hello world=E2=80=99
<= div class=3D"">where id =3D = 33
   and data is distinct from =E2=80=98hello = world=E2=80=99
;

= --Apple-Mail=_93C71D1F-5172-4B9E-B2CB-EC99488F5239--