Re: Toast space grows

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Toast space grows
Дата
Msg-id 11848.1204896799@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Toast space grows  ("Pavel Rotek" <pavel.rotek@gmail.com>)
Ответы Re: Toast space grows  (Matthew <matthew@flymine.org>)
Re: Toast space grows  ("Pavel Rotek" <pavel.rotek@gmail.com>)
Список pgsql-performance
"Pavel Rotek" <pavel.rotek@gmail.com> writes:
> No i do not mean long running transactions... Update of log entry (update of
> row in dataaction) is performed in series of short transactions, but during
> short transaction there is a lot of change log value, flush, change log
> value ,flush ..... change log value, flush actions (flush means perform
> flush operation via JDBC driver). I'm not sure if this flush affects toast
> space... Maybe this is the reason.

You mean that you build up the 5MB log entry by adding a few lines at a
time?  That's going to consume horrid amounts of toast space, because
each time you add a few lines, an entire new toasted field value is
created.

If you have to do it that way, you'll need very frequent vacuums on this
table (not vacuum full, as noted already) to keep the toast space from
bloating too much.  And make sure you've got max_fsm_pages set high
enough.

If you can restructure your code a bit, it might be better to accumulate
log values in a short-lived table and only store the final form of a log
entry into the main table.

            regards, tom lane

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Toast space grows
Следующее
От: Matthew
Дата:
Сообщение: Re: Toast space grows