Re: general questions postgresql performance config

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: general questions postgresql performance config
Дата
Msg-id 4B5F6B19.3090804@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: general questions postgresql performance config  (Andy Colson <andy@squeakycode.net>)
Список pgsql-general
Andy Colson wrote:
> I recall seeing someplace that you can avoid WAL if you start a
> transaction, then truncate the table, then start a COPY.
>
> Is that correct?  Still hold true?  Would it make a lot of difference?

That is correct, still true, and can make a moderate amount of
difference if the WAL is really your bottleneck.  More of a tweak for
loading small to medium size things as I see it.  Once the database and
possibly its indexes get large enough, the loading time starts being
dominated by handling all that work, with its random I/O, rather than
being limited by the sequential writes to the WAL.  It's certainly a
useful optimization to take advantage of when you can, given that it's
as easy as:

BEGIN;
TRUNCATE TABLE x;
COPY x FROM ... ;
COMMIT;

--
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com


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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: 100% of CPU utilization postgres process
Следующее
От: steeles@gmail.com
Дата:
Сообщение: Re: pg dump.. issue with when using crontab