Re: update with no changes - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: update with no changes
Date
Msg-id CAKFQuwb1ELH90uwa3NLaGtFMQ7mfUxK0JMGxHho0HvhCgNtYyQ@mail.gmail.com
Whole thread Raw
In response to Re: update with no changes  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: update with no changes
List pgsql-hackers
On Fri, Nov 19, 2021 at 10:03 AM Marcos Pegoraro <marcos@f10.com.br> wrote:
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.
But it takes resources for other operations, right ?
I think this is not unusual. If an user double click on a grid, just sees a record and clicks ok to save, probably that application calls an update instead of seeing if some field were changed before that. 


This has been the documented behavior for decades.  I suggest you research prior discussions on the topic if you need more than what has been provided.  You'd need to bring up some novel points about why a change here would be overall beneficial to get any interest, at least from me, in discussing the topic further.

I get the idea of letting the server centralize logic like this - but frankly if the application is choosing to send all that data across the wire just to have the server throw it away the application is wasting network I/O.  If it does manage its resources carefully then the server will never even see an update and its behavior here becomes moot.

David J.

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: sequence cache is kept forever
Next
From: Tom Lane
Date:
Subject: Re: sequence cache is kept forever