Re: Updates, deletes and inserts are very slow. What can I do make them bearable?

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Дата
Msg-id 4CBFB0AC.9060302@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Updates, deletes and inserts are very slow. What can I do make them bearable?  (Tim Uckun <timuckun@gmail.com>)
Ответы Re: Updates, deletes and inserts are very slow. What can I do make them bearable?  (Tim Uckun <timuckun@gmail.com>)
Список pgsql-general
Tim Uckun wrote:
> BTW I have read many of those links and have adjusted some values but
> honestly there are so many buttons to push and knobs to dial that it's
> hard to know what will fix what.
>

Generally update/delete tuning goes like this:

1) Increase checkpoint_segments (>64, increases beyond that can be
helpful but they eventually level out)
2) Increase shared_buffers (~25% of RAM is normal)
3) Confirm there are no constraints or foreign keys happening at each update
4) Make sure your indexes aren't filled with junk and that VACUUM is
running effectively.  REINDEX or CLUSTER tables that haven't been well
maintained in the past.
5) Upgrade to better hardware that has a battery-backed write cache
- or -
Disable synchronous_commit and cheat on individual commits, at the
expense of potential lost transactions after a crash.

Updating rows in PostgreSQL is one of the most intensive things you do
to your disks, and it's hard to get a laptop drive to do a very good job
at that.

--
Greg Smith, 2ndQuadrant US  greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services and Support     www.2ndQuadrant.us
PostgreSQL 9.0 High Performance http://www.2ndquadrant.com/books



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

Предыдущее
От: Tim Uckun
Дата:
Сообщение: Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Следующее
От: Josh Kupershmidt
Дата:
Сообщение: pg_temp implicit search path: functions vs. tables