Re: Performance impact of updating target columns with unchangedvalues ON CONFLICT

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: Performance impact of updating target columns with unchangedvalues ON CONFLICT
Дата
Msg-id 20181122224051.GK10913@telsasoft.com
обсуждение исходный текст
Ответ на Re: Performance impact of updating target columns with unchangedvalues ON CONFLICT  (Abi Noda <a@abinoda.com>)
Ответы Re: Performance impact of updating target columns with unchangedvalues ON CONFLICT  (Abi Noda <a@abinoda.com>)
Список pgsql-performance
On Thu, Nov 22, 2018 at 01:31:10PM -0800, Abi Noda wrote:
> In other words, is Postgres smart enough to not actually write to disk any
> columns that haven’t changed value or update indexes based on those columns?

You're asking about what's referred to as Heap only tuples:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/access/heap/README.HOT;hb=HEAD
https://wiki.postgresql.org/wiki/Index-only_scans#Interaction_with_HOT

Note, if you're doing alot of updates, you should consider setting a lower the
table fillfactor, since HOT is only possible if the new tuple (row version) is
on the same page as the old tuple.

|With HOT, a new tuple placed on the same page and with all indexed columns the
|same as its parent row version does not get new index entries."

And check pg_stat_user_tables to verify that's working as intended.

Justin


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

Предыдущее
От: Abi Noda
Дата:
Сообщение: Re: Performance impact of updating target columns with unchangedvalues ON CONFLICT
Следующее
От: Jakub Glapa
Дата:
Сообщение: Re: dsa_allocate() faliure