Re: What exactly is postgres doing during INSERT/UPDATE ?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: Joseph S <jks(at)selectacast(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: What exactly is postgres doing during INSERT/UPDATE ?
Date: 2009-08-28 08:29:17
Message-ID: dcc563d10908280129i2e4277b4r7abd9a982aeaae5b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Aug 28, 2009 at 2:08 AM, Greg Smith<gsmith(at)gregsmith(dot)com> wrote:
>
> This sort of workload involves random I/O rather than sequential.  On
> regular hard drives this normally happens at a tiny fraction of the speed
> because of how the disk has to seek around.  Typically a single drive
> capable of 50-100MB/s on sequential I/O will only do 1-2MB/s on a completely
> random workload.  You look like you're getting somewhere in the middle
> there, on the low side which doesn't surprise me.
>
> The main two things you can do to improve this on the database side:
>
> -Increase checkpoint_segments, which reduces how often updated data has to
> be flushed to disk
>
> -Increase shared_buffers in order to hold more of the working set of data in
> RAM, so that more reads are satisfied by the database cache and less data
> gets evicted to disk.

After that you have to start looking at hardware. Soimething as
simple as a different drive for indexes and another for WAL, and
another for the base tables can make a big difference.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joseph S 2009-08-28 14:25:10 Re: What exactly is postgres doing during INSERT/UPDATE ?
Previous Message Greg Smith 2009-08-28 08:08:15 Re: What exactly is postgres doing during INSERT/UPDATE ?