Re: update with no changes

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: update with no changes
Дата
Msg-id e5bdd1f7-5cd3-0408-eb78-da67106adbe6@dunslane.net
обсуждение исходный текст
Ответ на Re: update with no changes  (Marcos Pegoraro <marcos@f10.com.br>)
Список pgsql-hackers
On 11/20/21 10:03, Marcos Pegoraro wrote:
>
>     suppress_redundant_updates_trigger was created precisely because it's
>     not always easy to create application code in such a way that it
>     generates no redundant updates. However, there is a cost to using it,
>     and the break even point can be surprisingly high. It should therefore
>     be used with caution, and after appropriate benchmarks.
>
> well, there is a cost of not using it too. If lots of things needs to
> be done when a record is stored, and if it doesn´t needed to be
> stored, all these things will not be done.  So, what are pros of
> changing a record which did not changed any value and what are cons of
> it ? So, I understood the way it works and yes, my point of view is
> that this trigger is really needed, for me, obviously.



If you need it then use it. It's been built into postgres since release
8.4. Just be aware that if you use it there is a cost incurred for every
record updated whether or not the record is redundant. If only 12% of
your updates are redundant I suspect it will be a net loss for you, but
as I said above you should benchmark it.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marcos Pegoraro
Дата:
Сообщение: Re: update with no changes
Следующее
От: Todd Hubers
Дата:
Сообщение: Feature Proposal: Connection Pool Optimization - Change the Connection User