Re: Updates, deletes and inserts are very slow. What can I do make them bearable? - Mailing list pgsql-general

From Greg Smith
Subject Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Date
Msg-id 4CBFB0AC.9060302@2ndquadrant.com
Whole thread Raw
In response to Re: Updates, deletes and inserts are very slow. What can I do make them bearable?  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Updates, deletes and inserts are very slow. What can I do make them bearable?  (Tim Uckun <timuckun@gmail.com>)
List 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 by date:

Previous
From: Tim Uckun
Date:
Subject: Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Next
From: Josh Kupershmidt
Date:
Subject: pg_temp implicit search path: functions vs. tables