Re: [GENERAL] disk writes within a transaction

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: [GENERAL] disk writes within a transaction
Дата
Msg-id d5299a16-7022-c4e0-a1d1-da2418f2333a@aklaver.com
обсуждение исходный текст
Ответ на [GENERAL] disk writes within a transaction  (2xlp - ListSubscriptions <postgres@2xlp.com>)
Список pgsql-general
On 02/16/2017 11:33 AM, 2xlp - ListSubscriptions wrote:
> Can someone enlighten me to how postgres handles disk writing?  I've read some generic remarks about buffers, but
that'sabout it. 
>
> We have a chunk of code that calls Postgres in a less-than-optimal way within a transaction block.  I'm wondering
whereto prioritize fixing it, as the traffic on the wire isn't an issue. 
>
> Basically the code looks like this:
>
>     begin;
>     update foo set foo.a='1' where foo.bar = 1;
>     ...
>     update foo set foo.b='2' where foo.bar = 1;
>     ...
>     update foo set foo.c='3' where foo.bar = 1;
>     commit;
>
> If the updates are likely to be a memory based operation, consolidating them can wait.  If they are likely to hit the
disk,I should schedule refactoring this code sooner than later. 

I would suggest taking a look at:

https://www.postgresql.org/docs/9.6/static/wal-configuration.html



--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: 2xlp - ListSubscriptions
Дата:
Сообщение: [GENERAL] disk writes within a transaction
Следующее
От: David Hinkle
Дата:
Сообщение: Re: [GENERAL] Bad planning data resulting in OOM killing of postgres